@ozguraltan/strapi-content-input 1.0.23 → 1.0.24
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/README.md +5 -3
- package/dist/admin/{AnalyticsHubPage-K_trli5i.js → AnalyticsHubPage-ByOrVZCl.js} +372 -7
- package/dist/admin/{AnalyticsHubPage-Dvpx3KsP.mjs → AnalyticsHubPage-O-7pF2E5.mjs} +372 -7
- package/dist/admin/{ContentInputField-C2kmtUwD.mjs → ContentInputField-BoZHf0Ka.mjs} +2 -2
- package/dist/admin/{ContentInputField-CjxYYEps.js → ContentInputField-DK97AIG0.js} +2 -2
- package/dist/admin/{SurveyWidgetEditor-DOYxWop9.js → SurveyWidgetEditor-D3KiAotu.js} +2927 -302
- package/dist/admin/{SurveyWidgetEditor-DMWOkHUt.mjs → SurveyWidgetEditor-Y5BR-NWE.mjs} +2928 -304
- package/dist/admin/{index-AePRA0IB.mjs → index-C5Uj5YV9.mjs} +2 -2
- package/dist/admin/{index-B9C8Qrfd.js → index-CHtB_Fa5.js} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/widgets/SurveyTransferCleanupModal.d.ts +35 -0
- package/dist/admin/src/components/widgets/surveyStepTreeOps.d.ts +54 -0
- package/dist/server/index.js +613 -20
- package/dist/server/index.mjs +613 -20
- package/dist/server/src/controllers/ci-survey.d.ts +4 -0
- package/dist/server/src/controllers/index.d.ts +4 -0
- package/dist/server/src/index.d.ts +46 -1
- package/dist/server/src/services/ci-form.d.ts +5 -1
- package/dist/server/src/services/ci-survey.d.ts +37 -0
- package/dist/server/src/services/index.d.ts +42 -1
- package/dist/server/src/utils/demoSeedState.d.ts +14 -0
- package/package.json +1 -1
|
@@ -3,9 +3,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactDOM = require("react-dom");
|
|
5
5
|
const admin = require("@strapi/strapi/admin");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-CHtB_Fa5.js");
|
|
7
7
|
const cloneDeep = require("lodash/cloneDeep");
|
|
8
8
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
9
|
+
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
9
10
|
const ReactDOM__default = /* @__PURE__ */ _interopDefault(ReactDOM);
|
|
10
11
|
const cloneDeep__default = /* @__PURE__ */ _interopDefault(cloneDeep);
|
|
11
12
|
const ROW_PRESETS = [
|
|
@@ -10890,6 +10891,1440 @@ const SurveyLivePreviewPane = ({
|
|
|
10890
10891
|
}
|
|
10891
10892
|
);
|
|
10892
10893
|
};
|
|
10894
|
+
function triggerJsonDownload(filename, dataObj) {
|
|
10895
|
+
const jsonText = JSON.stringify(dataObj, null, 2);
|
|
10896
|
+
const blob = new Blob([jsonText], { type: "application/json;charset=utf-8" });
|
|
10897
|
+
const url = URL.createObjectURL(blob);
|
|
10898
|
+
const a = document.createElement("a");
|
|
10899
|
+
a.href = url;
|
|
10900
|
+
a.download = filename;
|
|
10901
|
+
document.body.appendChild(a);
|
|
10902
|
+
a.click();
|
|
10903
|
+
document.body.removeChild(a);
|
|
10904
|
+
URL.revokeObjectURL(url);
|
|
10905
|
+
}
|
|
10906
|
+
function sanitizeSurveyRecordForClientBundle(srv, rawResponses = []) {
|
|
10907
|
+
const cleanTitle = String(srv?.title || "Untitled Survey").trim();
|
|
10908
|
+
const cleanSlug = String(srv?.slug || "survey").trim();
|
|
10909
|
+
const sortedResponses = Array.isArray(rawResponses) ? [...rawResponses].sort((a, b) => {
|
|
10910
|
+
const ta = new Date(a?.submittedAt || a?.createdAt || 0).getTime();
|
|
10911
|
+
const tb = new Date(b?.submittedAt || b?.createdAt || 0).getTime();
|
|
10912
|
+
return ta - tb;
|
|
10913
|
+
}) : [];
|
|
10914
|
+
return {
|
|
10915
|
+
title: cleanTitle,
|
|
10916
|
+
titleI18n: srv?.titleI18n || { tr: cleanTitle, en: cleanTitle },
|
|
10917
|
+
slug: cleanSlug,
|
|
10918
|
+
description: srv?.description ?? { tr: "", en: "" },
|
|
10919
|
+
status: srv?.status || "published",
|
|
10920
|
+
displayMode: srv?.displayMode || "single_page",
|
|
10921
|
+
startsAt: srv?.startsAt || null,
|
|
10922
|
+
endsAt: srv?.endsAt || null,
|
|
10923
|
+
quotaLimit: srv?.quotaLimit ? Number(srv.quotaLimit) : null,
|
|
10924
|
+
submissionPolicy: srv?.submissionPolicy || "one_per_voter",
|
|
10925
|
+
anonymizeIp: srv?.anonymizeIp !== void 0 ? Boolean(srv.anonymizeIp) : true,
|
|
10926
|
+
showPublicResults: srv?.showPublicResults || "after_vote",
|
|
10927
|
+
allowBackNavigation: srv?.allowBackNavigation !== void 0 ? Boolean(srv.allowBackNavigation) : true,
|
|
10928
|
+
showProgressBar: srv?.showProgressBar !== void 0 ? Boolean(srv.showProgressBar) : true,
|
|
10929
|
+
useRecaptcha: srv?.useRecaptcha !== void 0 ? Boolean(srv.useRecaptcha) : false,
|
|
10930
|
+
recaptchaSiteKey: srv?.recaptchaSiteKey ? String(srv.recaptchaSiteKey) : "",
|
|
10931
|
+
steps: Array.isArray(srv?.steps) ? srv.steps : [],
|
|
10932
|
+
questions: Array.isArray(srv?.questions) ? srv.questions : [],
|
|
10933
|
+
settings: srv?.settings && typeof srv.settings === "object" ? srv.settings : {},
|
|
10934
|
+
version: Number(srv?.version || 1),
|
|
10935
|
+
responses: sortedResponses.map((r) => ({
|
|
10936
|
+
answers: r?.answers && typeof r.answers === "object" && !Array.isArray(r.answers) ? r.answers : {},
|
|
10937
|
+
otherTexts: r?.otherTexts && typeof r.otherTexts === "object" && !Array.isArray(r.otherTexts) ? r.otherTexts : {},
|
|
10938
|
+
score: typeof r?.score === "number" ? r.score : null,
|
|
10939
|
+
npsValue: typeof r?.npsValue === "number" ? r.npsValue : null,
|
|
10940
|
+
npsCategory: r?.npsCategory || null,
|
|
10941
|
+
locale: String(r?.locale || "en"),
|
|
10942
|
+
durationSeconds: Math.max(0, Number(r?.durationSeconds || 0) || 0),
|
|
10943
|
+
voterHash: r?.voterHash || null,
|
|
10944
|
+
respondentToken: r?.respondentToken || null,
|
|
10945
|
+
submittedAt: r?.submittedAt || r?.createdAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
10946
|
+
}))
|
|
10947
|
+
};
|
|
10948
|
+
}
|
|
10949
|
+
function buildClientDraftBundle(draft) {
|
|
10950
|
+
const portableItem = sanitizeSurveyRecordForClientBundle(draft, []);
|
|
10951
|
+
return {
|
|
10952
|
+
filename: `${portableItem.slug}-structure.ci-survey.json`,
|
|
10953
|
+
bundle: {
|
|
10954
|
+
packageType: "strapi-content-input-survey-bundle",
|
|
10955
|
+
schemaVersion: 1,
|
|
10956
|
+
mode: "structure",
|
|
10957
|
+
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
10958
|
+
surveyCount: 1,
|
|
10959
|
+
totalResponses: 0,
|
|
10960
|
+
surveys: [portableItem]
|
|
10961
|
+
}
|
|
10962
|
+
};
|
|
10963
|
+
}
|
|
10964
|
+
function isRouteNotLoadedError(err) {
|
|
10965
|
+
const status = err?.status || err?.response?.status;
|
|
10966
|
+
const msg = String(
|
|
10967
|
+
err?.response?.data?.error?.message || err?.message || ""
|
|
10968
|
+
).toLowerCase();
|
|
10969
|
+
return status === 404 && (msg === "not found" || msg.includes("not found"));
|
|
10970
|
+
}
|
|
10971
|
+
const SurveyExportModal = ({
|
|
10972
|
+
open,
|
|
10973
|
+
uiLocale = "en",
|
|
10974
|
+
targetSurvey,
|
|
10975
|
+
allowAllSurveys = false,
|
|
10976
|
+
defaultScope = "single",
|
|
10977
|
+
totalSurveysCount = 0,
|
|
10978
|
+
isUnsavedDraft = false,
|
|
10979
|
+
onClose
|
|
10980
|
+
}) => {
|
|
10981
|
+
const tr = uiLocale === "tr";
|
|
10982
|
+
const { get } = admin.useFetchClient();
|
|
10983
|
+
const [scope, setScope] = React.useState(
|
|
10984
|
+
!targetSurvey && allowAllSurveys ? "all" : defaultScope
|
|
10985
|
+
);
|
|
10986
|
+
const [mode, setMode] = React.useState("full");
|
|
10987
|
+
const [busy, setBusy] = React.useState(false);
|
|
10988
|
+
const [errorMsg, setErrorMsg] = React.useState("");
|
|
10989
|
+
React__default.default.useEffect(() => {
|
|
10990
|
+
if (open) {
|
|
10991
|
+
setScope(!targetSurvey && allowAllSurveys ? "all" : defaultScope);
|
|
10992
|
+
setMode(isUnsavedDraft ? "structure" : "full");
|
|
10993
|
+
setErrorMsg("");
|
|
10994
|
+
}
|
|
10995
|
+
}, [open, targetSurvey, allowAllSurveys, defaultScope, isUnsavedDraft]);
|
|
10996
|
+
if (!open || typeof document === "undefined") return null;
|
|
10997
|
+
const handleExport = async () => {
|
|
10998
|
+
setBusy(true);
|
|
10999
|
+
setErrorMsg("");
|
|
11000
|
+
try {
|
|
11001
|
+
if (scope === "single" && targetSurvey && isUnsavedDraft) {
|
|
11002
|
+
const localPkg = buildClientDraftBundle(targetSurvey);
|
|
11003
|
+
triggerJsonDownload(localPkg.filename, localPkg.bundle);
|
|
11004
|
+
onClose();
|
|
11005
|
+
return;
|
|
11006
|
+
}
|
|
11007
|
+
const targetParam = scope === "all" ? "all" : String(targetSurvey?.slug || targetSurvey?.id || "");
|
|
11008
|
+
if (!targetParam) {
|
|
11009
|
+
setErrorMsg(tr ? "Dışa aktarılacak anket bulunamadı." : "No survey selected.");
|
|
11010
|
+
return;
|
|
11011
|
+
}
|
|
11012
|
+
try {
|
|
11013
|
+
const res = await get(
|
|
11014
|
+
`/content-input/survey-bundle/export?target=${encodeURIComponent(
|
|
11015
|
+
targetParam
|
|
11016
|
+
)}&mode=${mode}`
|
|
11017
|
+
);
|
|
11018
|
+
const payload = res?.data;
|
|
11019
|
+
if (payload?.bundle) {
|
|
11020
|
+
triggerJsonDownload(
|
|
11021
|
+
payload.filename || `survey-${mode}.ci-survey.json`,
|
|
11022
|
+
payload.bundle
|
|
11023
|
+
);
|
|
11024
|
+
onClose();
|
|
11025
|
+
return;
|
|
11026
|
+
}
|
|
11027
|
+
} catch (bundleErr) {
|
|
11028
|
+
if (!isRouteNotLoadedError(bundleErr)) {
|
|
11029
|
+
throw bundleErr;
|
|
11030
|
+
}
|
|
11031
|
+
let list = [];
|
|
11032
|
+
if (scope === "all") {
|
|
11033
|
+
const allRes = await get("/content-input/surveys");
|
|
11034
|
+
list = Array.isArray(allRes?.data) ? allRes.data : [];
|
|
11035
|
+
} else {
|
|
11036
|
+
const oneRes = await get(
|
|
11037
|
+
`/content-input/surveys/${encodeURIComponent(targetParam)}`
|
|
11038
|
+
);
|
|
11039
|
+
if (oneRes?.data) list = [oneRes.data];
|
|
11040
|
+
}
|
|
11041
|
+
if (list.length === 0) {
|
|
11042
|
+
throw new Error(tr ? "Anket bulunamadı." : "Survey not found.");
|
|
11043
|
+
}
|
|
11044
|
+
let totalResponses = 0;
|
|
11045
|
+
const portableSurveys = [];
|
|
11046
|
+
for (const srv of list) {
|
|
11047
|
+
let rawResps = [];
|
|
11048
|
+
if (mode === "full" && srv?.slug) {
|
|
11049
|
+
const rRes = await get(
|
|
11050
|
+
`/content-input/surveys/${encodeURIComponent(srv.slug)}/responses?limit=500`
|
|
11051
|
+
);
|
|
11052
|
+
rawResps = Array.isArray(rRes?.data) ? rRes.data : [];
|
|
11053
|
+
}
|
|
11054
|
+
const item = sanitizeSurveyRecordForClientBundle(srv, rawResps);
|
|
11055
|
+
totalResponses += item.responses.length;
|
|
11056
|
+
portableSurveys.push(item);
|
|
11057
|
+
}
|
|
11058
|
+
const dateStamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
11059
|
+
const modeSuffix = mode === "full" ? "full-backup" : "structure";
|
|
11060
|
+
const fallbackFilename = scope === "single" && portableSurveys[0]?.slug ? `${portableSurveys[0].slug}-${modeSuffix}.ci-survey.json` : `ci-surveys-all-${modeSuffix}-${dateStamp}.ci-survey.json`;
|
|
11061
|
+
triggerJsonDownload(fallbackFilename, {
|
|
11062
|
+
packageType: "strapi-content-input-survey-bundle",
|
|
11063
|
+
schemaVersion: 1,
|
|
11064
|
+
mode,
|
|
11065
|
+
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11066
|
+
surveyCount: portableSurveys.length,
|
|
11067
|
+
totalResponses,
|
|
11068
|
+
surveys: portableSurveys
|
|
11069
|
+
});
|
|
11070
|
+
onClose();
|
|
11071
|
+
return;
|
|
11072
|
+
}
|
|
11073
|
+
} catch (err) {
|
|
11074
|
+
setErrorMsg(err?.message || (tr ? "Dışa aktarma başarısız oldu." : "Export failed."));
|
|
11075
|
+
} finally {
|
|
11076
|
+
setBusy(false);
|
|
11077
|
+
}
|
|
11078
|
+
};
|
|
11079
|
+
return ReactDOM.createPortal(
|
|
11080
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11081
|
+
"div",
|
|
11082
|
+
{
|
|
11083
|
+
className: "ci-root",
|
|
11084
|
+
style: {
|
|
11085
|
+
position: "fixed",
|
|
11086
|
+
inset: 0,
|
|
11087
|
+
background: "rgba(15, 23, 42, 0.68)",
|
|
11088
|
+
zIndex: 310,
|
|
11089
|
+
display: "flex",
|
|
11090
|
+
alignItems: "center",
|
|
11091
|
+
justifyContent: "center",
|
|
11092
|
+
padding: 16
|
|
11093
|
+
},
|
|
11094
|
+
onClick: onClose,
|
|
11095
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11096
|
+
"div",
|
|
11097
|
+
{
|
|
11098
|
+
style: {
|
|
11099
|
+
width: "100%",
|
|
11100
|
+
maxWidth: 540,
|
|
11101
|
+
background: "#ffffff",
|
|
11102
|
+
borderRadius: 12,
|
|
11103
|
+
boxShadow: "0 24px 54px rgba(15, 23, 42, 0.4)",
|
|
11104
|
+
overflow: "hidden",
|
|
11105
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"
|
|
11106
|
+
},
|
|
11107
|
+
onClick: (e) => e.stopPropagation(),
|
|
11108
|
+
children: [
|
|
11109
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11110
|
+
"div",
|
|
11111
|
+
{
|
|
11112
|
+
style: {
|
|
11113
|
+
padding: "14px 18px",
|
|
11114
|
+
background: "#0f172a",
|
|
11115
|
+
color: "#ffffff",
|
|
11116
|
+
display: "flex",
|
|
11117
|
+
alignItems: "center",
|
|
11118
|
+
justifyContent: "space-between"
|
|
11119
|
+
},
|
|
11120
|
+
children: [
|
|
11121
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
11122
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "download", size: 20, color: "#38bdf8" }),
|
|
11123
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14, fontWeight: 700 }, children: tr ? "Anket Paketi Dışa Aktar (.ci-survey.json)" : "Export Survey Package (.ci-survey.json)" })
|
|
11124
|
+
] }),
|
|
11125
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11126
|
+
"button",
|
|
11127
|
+
{
|
|
11128
|
+
type: "button",
|
|
11129
|
+
onClick: onClose,
|
|
11130
|
+
style: {
|
|
11131
|
+
border: "none",
|
|
11132
|
+
background: "transparent",
|
|
11133
|
+
color: "#cbd5e1",
|
|
11134
|
+
fontSize: 18,
|
|
11135
|
+
cursor: "pointer"
|
|
11136
|
+
},
|
|
11137
|
+
children: "×"
|
|
11138
|
+
}
|
|
11139
|
+
)
|
|
11140
|
+
]
|
|
11141
|
+
}
|
|
11142
|
+
),
|
|
11143
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: 18, display: "flex", flexDirection: "column", gap: 14 }, children: [
|
|
11144
|
+
allowAllSurveys && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11145
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11146
|
+
"div",
|
|
11147
|
+
{
|
|
11148
|
+
style: {
|
|
11149
|
+
fontSize: 11.5,
|
|
11150
|
+
fontWeight: 700,
|
|
11151
|
+
color: "#334155",
|
|
11152
|
+
marginBottom: 6
|
|
11153
|
+
},
|
|
11154
|
+
children: tr ? "1. Dışa Aktarım Kapsamı" : "1. Export Scope"
|
|
11155
|
+
}
|
|
11156
|
+
),
|
|
11157
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
|
|
11158
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11159
|
+
"button",
|
|
11160
|
+
{
|
|
11161
|
+
type: "button",
|
|
11162
|
+
disabled: !targetSurvey,
|
|
11163
|
+
onClick: () => setScope("single"),
|
|
11164
|
+
style: {
|
|
11165
|
+
padding: "9px 10px",
|
|
11166
|
+
borderRadius: 8,
|
|
11167
|
+
border: scope === "single" ? "2px solid #2563eb" : "1px solid #cbd5e1",
|
|
11168
|
+
background: scope === "single" ? "#eff6ff" : "#f8fafc",
|
|
11169
|
+
color: !targetSurvey ? "#94a3b8" : scope === "single" ? "#1e3a8a" : "#334155",
|
|
11170
|
+
fontSize: 12,
|
|
11171
|
+
fontWeight: 700,
|
|
11172
|
+
cursor: !targetSurvey ? "not-allowed" : "pointer",
|
|
11173
|
+
textAlign: "left"
|
|
11174
|
+
},
|
|
11175
|
+
children: [
|
|
11176
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: tr ? "Seçili Anket" : "Selected Survey" }),
|
|
11177
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11178
|
+
"div",
|
|
11179
|
+
{
|
|
11180
|
+
style: {
|
|
11181
|
+
fontSize: 10.5,
|
|
11182
|
+
fontWeight: 500,
|
|
11183
|
+
color: "#64748b",
|
|
11184
|
+
marginTop: 2,
|
|
11185
|
+
overflow: "hidden",
|
|
11186
|
+
textOverflow: "ellipsis",
|
|
11187
|
+
whiteSpace: "nowrap"
|
|
11188
|
+
},
|
|
11189
|
+
children: targetSurvey ? targetSurvey.title : "-"
|
|
11190
|
+
}
|
|
11191
|
+
)
|
|
11192
|
+
]
|
|
11193
|
+
}
|
|
11194
|
+
),
|
|
11195
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11196
|
+
"button",
|
|
11197
|
+
{
|
|
11198
|
+
type: "button",
|
|
11199
|
+
disabled: totalSurveysCount === 0,
|
|
11200
|
+
onClick: () => setScope("all"),
|
|
11201
|
+
style: {
|
|
11202
|
+
padding: "9px 10px",
|
|
11203
|
+
borderRadius: 8,
|
|
11204
|
+
border: scope === "all" ? "2px solid #2563eb" : "1px solid #cbd5e1",
|
|
11205
|
+
background: scope === "all" ? "#eff6ff" : "#f8fafc",
|
|
11206
|
+
color: totalSurveysCount === 0 ? "#94a3b8" : scope === "all" ? "#1e3a8a" : "#334155",
|
|
11207
|
+
fontSize: 12,
|
|
11208
|
+
fontWeight: 700,
|
|
11209
|
+
cursor: totalSurveysCount === 0 ? "not-allowed" : "pointer",
|
|
11210
|
+
textAlign: "left"
|
|
11211
|
+
},
|
|
11212
|
+
children: [
|
|
11213
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: tr ? "Tüm Anketler (Toplu Paket)" : "All Surveys (Bundle)" }),
|
|
11214
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 10.5, fontWeight: 500, color: "#64748b", marginTop: 2 }, children: tr ? `${totalSurveysCount} anket tek dosyada` : `${totalSurveysCount} surveys in one file` })
|
|
11215
|
+
]
|
|
11216
|
+
}
|
|
11217
|
+
)
|
|
11218
|
+
] })
|
|
11219
|
+
] }),
|
|
11220
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11221
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11222
|
+
"div",
|
|
11223
|
+
{
|
|
11224
|
+
style: {
|
|
11225
|
+
fontSize: 11.5,
|
|
11226
|
+
fontWeight: 700,
|
|
11227
|
+
color: "#334155",
|
|
11228
|
+
marginBottom: 6
|
|
11229
|
+
},
|
|
11230
|
+
children: allowAllSurveys ? tr ? "2. Paket İçeriği Seçin" : "2. Choose Package Mode" : tr ? "Paket İçeriği Seçin" : "Choose Package Mode"
|
|
11231
|
+
}
|
|
11232
|
+
),
|
|
11233
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
11234
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11235
|
+
"label",
|
|
11236
|
+
{
|
|
11237
|
+
onClick: () => setMode("structure"),
|
|
11238
|
+
style: {
|
|
11239
|
+
padding: 12,
|
|
11240
|
+
borderRadius: 9,
|
|
11241
|
+
border: mode === "structure" ? "2px solid #2563eb" : "1px solid #cbd5e1",
|
|
11242
|
+
background: mode === "structure" ? "#eff6ff" : "#ffffff",
|
|
11243
|
+
cursor: "pointer",
|
|
11244
|
+
display: "flex",
|
|
11245
|
+
alignItems: "flex-start",
|
|
11246
|
+
gap: 10
|
|
11247
|
+
},
|
|
11248
|
+
children: [
|
|
11249
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11250
|
+
"input",
|
|
11251
|
+
{
|
|
11252
|
+
type: "radio",
|
|
11253
|
+
checked: mode === "structure",
|
|
11254
|
+
onChange: () => setMode("structure"),
|
|
11255
|
+
style: { marginTop: 3 }
|
|
11256
|
+
}
|
|
11257
|
+
),
|
|
11258
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11259
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12.5, fontWeight: 700, color: "#0f172a" }, children: tr ? "Sadece Yapı (Şema, Kategoriler, Sorular & Kurallar)" : "Structure Only (Schema, Steps, Questions & Logic)" }),
|
|
11260
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 11, color: "#475569", marginTop: 3, lineHeight: 1.45 }, children: tr ? "Tüm adımlar, çok dilli metinler, ölçek etiketleri ve koşullu mantık kurallarını dışa aktarır. Yanıt verisi içermez (0 yanıt). Şablon taşımak için idealdir." : "Exports all wizard steps, localized labels, scale labels, and skip-logic rules without participant responses (0 responses). Ideal for templates." })
|
|
11261
|
+
] })
|
|
11262
|
+
]
|
|
11263
|
+
}
|
|
11264
|
+
),
|
|
11265
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11266
|
+
"label",
|
|
11267
|
+
{
|
|
11268
|
+
onClick: () => {
|
|
11269
|
+
if (!isUnsavedDraft) setMode("full");
|
|
11270
|
+
},
|
|
11271
|
+
style: {
|
|
11272
|
+
padding: 12,
|
|
11273
|
+
borderRadius: 9,
|
|
11274
|
+
border: mode === "full" ? "2px solid #059669" : "1px solid #cbd5e1",
|
|
11275
|
+
background: isUnsavedDraft ? "#f8fafc" : mode === "full" ? "#ecfdf5" : "#ffffff",
|
|
11276
|
+
opacity: isUnsavedDraft ? 0.6 : 1,
|
|
11277
|
+
cursor: isUnsavedDraft ? "not-allowed" : "pointer",
|
|
11278
|
+
display: "flex",
|
|
11279
|
+
alignItems: "flex-start",
|
|
11280
|
+
gap: 10
|
|
11281
|
+
},
|
|
11282
|
+
children: [
|
|
11283
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11284
|
+
"input",
|
|
11285
|
+
{
|
|
11286
|
+
type: "radio",
|
|
11287
|
+
disabled: isUnsavedDraft,
|
|
11288
|
+
checked: mode === "full",
|
|
11289
|
+
onChange: () => setMode("full"),
|
|
11290
|
+
style: { marginTop: 3 }
|
|
11291
|
+
}
|
|
11292
|
+
),
|
|
11293
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11294
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12.5, fontWeight: 700, color: "#0f172a" }, children: tr ? "Yapı + Yanıt Verileri (Tam Yedek & Rapor Canlandırma)" : "Structure + Response Data (Full Backup & Analytics Restore)" }),
|
|
11295
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 11, color: "#475569", marginTop: 3, lineHeight: 1.45 }, children: isUnsavedDraft ? tr ? "Bu taslak henüz kaydedilmediği için sunucuda yanıt verisi bulunmuyor." : "Save this draft first to export server responses." : tr ? "Anket şemasıyla birlikte tüm katılımcı yanıtlarını, NPS skorlarını ve tarihçeyi dışa aktarır. İçe aktarıldığında tüm grafikler birebir canlanır." : "Includes complete survey structure plus all recorded responses, NPS metrics, and timestamps so charts and Excel exports revive 1:1." })
|
|
11296
|
+
] })
|
|
11297
|
+
]
|
|
11298
|
+
}
|
|
11299
|
+
)
|
|
11300
|
+
] })
|
|
11301
|
+
] }),
|
|
11302
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11303
|
+
"div",
|
|
11304
|
+
{
|
|
11305
|
+
style: {
|
|
11306
|
+
padding: "8px 11px",
|
|
11307
|
+
borderRadius: 7,
|
|
11308
|
+
background: "#f8fafc",
|
|
11309
|
+
border: "1px solid #e2e8f0",
|
|
11310
|
+
fontSize: 11,
|
|
11311
|
+
color: "#64748b"
|
|
11312
|
+
},
|
|
11313
|
+
children: tr ? "Güvenlik notu: Gizli reCAPTCHA Secret Key ve özel SMTP parolaları dışa aktarılan JSON paketine dahil edilmez." : "Security note: Private reCAPTCHA secret keys and SMTP credentials are automatically stripped from exported packages."
|
|
11314
|
+
}
|
|
11315
|
+
),
|
|
11316
|
+
errorMsg && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11317
|
+
"div",
|
|
11318
|
+
{
|
|
11319
|
+
style: {
|
|
11320
|
+
padding: "8px 12px",
|
|
11321
|
+
borderRadius: 7,
|
|
11322
|
+
background: "#fee2e2",
|
|
11323
|
+
color: "#991b1b",
|
|
11324
|
+
fontSize: 11.5,
|
|
11325
|
+
fontWeight: 600
|
|
11326
|
+
},
|
|
11327
|
+
children: errorMsg
|
|
11328
|
+
}
|
|
11329
|
+
),
|
|
11330
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8 }, children: [
|
|
11331
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11332
|
+
"button",
|
|
11333
|
+
{
|
|
11334
|
+
type: "button",
|
|
11335
|
+
onClick: onClose,
|
|
11336
|
+
style: {
|
|
11337
|
+
padding: "8px 14px",
|
|
11338
|
+
borderRadius: 7,
|
|
11339
|
+
border: "1px solid #cbd5e1",
|
|
11340
|
+
background: "#ffffff",
|
|
11341
|
+
color: "#334155",
|
|
11342
|
+
fontSize: 12,
|
|
11343
|
+
fontWeight: 600,
|
|
11344
|
+
cursor: "pointer"
|
|
11345
|
+
},
|
|
11346
|
+
children: tr ? "Vazgeç" : "Cancel"
|
|
11347
|
+
}
|
|
11348
|
+
),
|
|
11349
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11350
|
+
"button",
|
|
11351
|
+
{
|
|
11352
|
+
type: "button",
|
|
11353
|
+
disabled: busy,
|
|
11354
|
+
onClick: handleExport,
|
|
11355
|
+
style: {
|
|
11356
|
+
padding: "8px 16px",
|
|
11357
|
+
borderRadius: 7,
|
|
11358
|
+
border: "none",
|
|
11359
|
+
background: mode === "full" ? "#059669" : "#2563eb",
|
|
11360
|
+
color: "#ffffff",
|
|
11361
|
+
fontSize: 12,
|
|
11362
|
+
fontWeight: 700,
|
|
11363
|
+
cursor: "pointer",
|
|
11364
|
+
display: "inline-flex",
|
|
11365
|
+
alignItems: "center",
|
|
11366
|
+
gap: 6
|
|
11367
|
+
},
|
|
11368
|
+
children: [
|
|
11369
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "download", size: 16, color: "#fff" }),
|
|
11370
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: busy ? tr ? "Hazırlanıyor..." : "Preparing..." : tr ? "JSON Paketini İndir" : "Download JSON Package" })
|
|
11371
|
+
]
|
|
11372
|
+
}
|
|
11373
|
+
)
|
|
11374
|
+
] })
|
|
11375
|
+
] })
|
|
11376
|
+
]
|
|
11377
|
+
}
|
|
11378
|
+
)
|
|
11379
|
+
}
|
|
11380
|
+
),
|
|
11381
|
+
document.body
|
|
11382
|
+
);
|
|
11383
|
+
};
|
|
11384
|
+
function inspectSurveyBundle(raw, existingSlugs) {
|
|
11385
|
+
let items = [];
|
|
11386
|
+
let mode = "structure";
|
|
11387
|
+
if (Array.isArray(raw)) {
|
|
11388
|
+
items = raw;
|
|
11389
|
+
} else if (raw && typeof raw === "object") {
|
|
11390
|
+
if (typeof raw.mode === "string") mode = raw.mode;
|
|
11391
|
+
if (Array.isArray(raw.surveys)) {
|
|
11392
|
+
items = raw.surveys;
|
|
11393
|
+
} else if (Array.isArray(raw.questions) || raw.title || raw.slug) {
|
|
11394
|
+
items = [raw];
|
|
11395
|
+
}
|
|
11396
|
+
}
|
|
11397
|
+
const valid = items.filter(
|
|
11398
|
+
(it) => it && typeof it === "object" && (Array.isArray(it.questions) || it.title)
|
|
11399
|
+
);
|
|
11400
|
+
if (valid.length === 0) return null;
|
|
11401
|
+
let totalQuestions = 0;
|
|
11402
|
+
let totalResponses = 0;
|
|
11403
|
+
let conflictCount = 0;
|
|
11404
|
+
const surveys = valid.map((it) => {
|
|
11405
|
+
const slug = String(it.slug || "").trim();
|
|
11406
|
+
const stepCount = Array.isArray(it.steps) ? it.steps.length : 0;
|
|
11407
|
+
const questionCount = Array.isArray(it.questions) ? it.questions.length : 0;
|
|
11408
|
+
const responseCount = Array.isArray(it.responses) ? it.responses.length : 0;
|
|
11409
|
+
const hasConflict = Boolean(slug && existingSlugs.has(slug));
|
|
11410
|
+
totalQuestions += questionCount;
|
|
11411
|
+
totalResponses += responseCount;
|
|
11412
|
+
if (hasConflict) conflictCount += 1;
|
|
11413
|
+
return {
|
|
11414
|
+
title: String(it.title || slug || "Survey"),
|
|
11415
|
+
slug: slug || "(auto)",
|
|
11416
|
+
displayMode: String(it.displayMode || "single_page"),
|
|
11417
|
+
stepCount,
|
|
11418
|
+
questionCount,
|
|
11419
|
+
responseCount,
|
|
11420
|
+
hasConflict
|
|
11421
|
+
};
|
|
11422
|
+
});
|
|
11423
|
+
if (totalResponses > 0) mode = "full";
|
|
11424
|
+
return {
|
|
11425
|
+
raw,
|
|
11426
|
+
mode,
|
|
11427
|
+
surveys,
|
|
11428
|
+
totalQuestions,
|
|
11429
|
+
totalResponses,
|
|
11430
|
+
conflictCount
|
|
11431
|
+
};
|
|
11432
|
+
}
|
|
11433
|
+
const SurveyImportModal = ({
|
|
11434
|
+
open,
|
|
11435
|
+
uiLocale = "en",
|
|
11436
|
+
existingSlugs = [],
|
|
11437
|
+
onClose,
|
|
11438
|
+
onImported
|
|
11439
|
+
}) => {
|
|
11440
|
+
const tr = uiLocale === "tr";
|
|
11441
|
+
const { post } = admin.useFetchClient();
|
|
11442
|
+
const fileInputRef = React.useRef(null);
|
|
11443
|
+
const [fileName, setFileName] = React.useState("");
|
|
11444
|
+
const [summary, setSummary] = React.useState(null);
|
|
11445
|
+
const [conflictStrategy, setConflictStrategy] = React.useState(
|
|
11446
|
+
"duplicate"
|
|
11447
|
+
);
|
|
11448
|
+
const [includeResponses, setIncludeResponses] = React.useState(true);
|
|
11449
|
+
const [dragOver, setDragOver] = React.useState(false);
|
|
11450
|
+
const [importing, setImporting] = React.useState(false);
|
|
11451
|
+
const [errorMsg, setErrorMsg] = React.useState("");
|
|
11452
|
+
React__default.default.useEffect(() => {
|
|
11453
|
+
if (open) {
|
|
11454
|
+
setFileName("");
|
|
11455
|
+
setSummary(null);
|
|
11456
|
+
setConflictStrategy("duplicate");
|
|
11457
|
+
setIncludeResponses(true);
|
|
11458
|
+
setErrorMsg("");
|
|
11459
|
+
}
|
|
11460
|
+
}, [open]);
|
|
11461
|
+
if (!open || typeof document === "undefined") return null;
|
|
11462
|
+
const slugSet = new Set(existingSlugs.map((s) => String(s || "").trim()).filter(Boolean));
|
|
11463
|
+
const parseFile = (file) => {
|
|
11464
|
+
setErrorMsg("");
|
|
11465
|
+
setFileName(file.name);
|
|
11466
|
+
const reader = new FileReader();
|
|
11467
|
+
reader.onload = () => {
|
|
11468
|
+
try {
|
|
11469
|
+
const parsed = JSON.parse(String(reader.result || ""));
|
|
11470
|
+
const inspected = inspectSurveyBundle(parsed, slugSet);
|
|
11471
|
+
if (!inspected) {
|
|
11472
|
+
setSummary(null);
|
|
11473
|
+
setErrorMsg(
|
|
11474
|
+
tr ? "Seçilen JSON dosyasında geçerli bir ContentInput anket tanımı bulunamadı." : "No valid ContentInput survey definition found in this JSON file."
|
|
11475
|
+
);
|
|
11476
|
+
return;
|
|
11477
|
+
}
|
|
11478
|
+
setSummary(inspected);
|
|
11479
|
+
setIncludeResponses(inspected.totalResponses > 0);
|
|
11480
|
+
} catch {
|
|
11481
|
+
setSummary(null);
|
|
11482
|
+
setErrorMsg(
|
|
11483
|
+
tr ? "Dosya geçerli bir JSON formatında değil." : "Invalid JSON file format."
|
|
11484
|
+
);
|
|
11485
|
+
}
|
|
11486
|
+
};
|
|
11487
|
+
reader.readAsText(file, "utf-8");
|
|
11488
|
+
};
|
|
11489
|
+
const handleImport = async () => {
|
|
11490
|
+
if (!summary) return;
|
|
11491
|
+
setImporting(true);
|
|
11492
|
+
setErrorMsg("");
|
|
11493
|
+
try {
|
|
11494
|
+
const res = await post("/content-input/survey-bundle/import", {
|
|
11495
|
+
bundle: summary.raw,
|
|
11496
|
+
conflictStrategy,
|
|
11497
|
+
includeResponses: summary.totalResponses > 0 ? includeResponses : false
|
|
11498
|
+
});
|
|
11499
|
+
const data = res?.data || {};
|
|
11500
|
+
onImported({
|
|
11501
|
+
importedCount: Number(data.importedCount || 0),
|
|
11502
|
+
importedResponsesCount: Number(data.importedResponsesCount || 0),
|
|
11503
|
+
importedSurveys: Array.isArray(data.importedSurveys) ? data.importedSurveys : []
|
|
11504
|
+
});
|
|
11505
|
+
onClose();
|
|
11506
|
+
} catch (err) {
|
|
11507
|
+
if (isRouteNotLoadedError(err)) {
|
|
11508
|
+
setErrorMsg(
|
|
11509
|
+
tr ? "Yeni sunucu rotalarının aktif olması için lütfen Strapi sunucusunu (npm run dev) bir kez yeniden başlatın." : "Please restart the Strapi server (npm run dev) once so the new backend routes take effect."
|
|
11510
|
+
);
|
|
11511
|
+
} else {
|
|
11512
|
+
setErrorMsg(
|
|
11513
|
+
err?.response?.data?.error?.message || err?.message || (tr ? "İçe aktarma başarısız oldu." : "Import failed.")
|
|
11514
|
+
);
|
|
11515
|
+
}
|
|
11516
|
+
} finally {
|
|
11517
|
+
setImporting(false);
|
|
11518
|
+
}
|
|
11519
|
+
};
|
|
11520
|
+
return ReactDOM.createPortal(
|
|
11521
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11522
|
+
"div",
|
|
11523
|
+
{
|
|
11524
|
+
className: "ci-root",
|
|
11525
|
+
style: {
|
|
11526
|
+
position: "fixed",
|
|
11527
|
+
inset: 0,
|
|
11528
|
+
background: "rgba(15, 23, 42, 0.68)",
|
|
11529
|
+
zIndex: 310,
|
|
11530
|
+
display: "flex",
|
|
11531
|
+
alignItems: "center",
|
|
11532
|
+
justifyContent: "center",
|
|
11533
|
+
padding: 16
|
|
11534
|
+
},
|
|
11535
|
+
onClick: onClose,
|
|
11536
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11537
|
+
"div",
|
|
11538
|
+
{
|
|
11539
|
+
style: {
|
|
11540
|
+
width: "100%",
|
|
11541
|
+
maxWidth: 590,
|
|
11542
|
+
maxHeight: "90vh",
|
|
11543
|
+
background: "#ffffff",
|
|
11544
|
+
borderRadius: 12,
|
|
11545
|
+
boxShadow: "0 24px 54px rgba(15, 23, 42, 0.4)",
|
|
11546
|
+
display: "flex",
|
|
11547
|
+
flexDirection: "column",
|
|
11548
|
+
overflow: "hidden",
|
|
11549
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"
|
|
11550
|
+
},
|
|
11551
|
+
onClick: (e) => e.stopPropagation(),
|
|
11552
|
+
children: [
|
|
11553
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11554
|
+
"div",
|
|
11555
|
+
{
|
|
11556
|
+
style: {
|
|
11557
|
+
padding: "14px 18px",
|
|
11558
|
+
background: "#0f172a",
|
|
11559
|
+
color: "#ffffff",
|
|
11560
|
+
display: "flex",
|
|
11561
|
+
alignItems: "center",
|
|
11562
|
+
justifyContent: "space-between"
|
|
11563
|
+
},
|
|
11564
|
+
children: [
|
|
11565
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
11566
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "upload_file", size: 20, color: "#38bdf8" }),
|
|
11567
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14, fontWeight: 700 }, children: tr ? "JSON Paketinden Anket Canlandır / İçe Aktar" : "Import & Revive Survey from JSON Package" })
|
|
11568
|
+
] }),
|
|
11569
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11570
|
+
"button",
|
|
11571
|
+
{
|
|
11572
|
+
type: "button",
|
|
11573
|
+
onClick: onClose,
|
|
11574
|
+
style: {
|
|
11575
|
+
border: "none",
|
|
11576
|
+
background: "transparent",
|
|
11577
|
+
color: "#cbd5e1",
|
|
11578
|
+
fontSize: 18,
|
|
11579
|
+
cursor: "pointer"
|
|
11580
|
+
},
|
|
11581
|
+
children: "×"
|
|
11582
|
+
}
|
|
11583
|
+
)
|
|
11584
|
+
]
|
|
11585
|
+
}
|
|
11586
|
+
),
|
|
11587
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11588
|
+
"div",
|
|
11589
|
+
{
|
|
11590
|
+
style: {
|
|
11591
|
+
padding: 18,
|
|
11592
|
+
overflowY: "auto",
|
|
11593
|
+
display: "flex",
|
|
11594
|
+
flexDirection: "column",
|
|
11595
|
+
gap: 14
|
|
11596
|
+
},
|
|
11597
|
+
children: [
|
|
11598
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11599
|
+
"div",
|
|
11600
|
+
{
|
|
11601
|
+
onClick: () => fileInputRef.current?.click(),
|
|
11602
|
+
onDragOver: (e) => {
|
|
11603
|
+
e.preventDefault();
|
|
11604
|
+
setDragOver(true);
|
|
11605
|
+
},
|
|
11606
|
+
onDragLeave: () => setDragOver(false),
|
|
11607
|
+
onDrop: (e) => {
|
|
11608
|
+
e.preventDefault();
|
|
11609
|
+
setDragOver(false);
|
|
11610
|
+
const f = e.dataTransfer.files?.[0];
|
|
11611
|
+
if (f) parseFile(f);
|
|
11612
|
+
},
|
|
11613
|
+
style: {
|
|
11614
|
+
padding: "20px 16px",
|
|
11615
|
+
borderRadius: 10,
|
|
11616
|
+
border: dragOver ? "2px dashed #2563eb" : "2px dashed #cbd5e1",
|
|
11617
|
+
background: dragOver ? "#eff6ff" : "#f8fafc",
|
|
11618
|
+
textAlign: "center",
|
|
11619
|
+
cursor: "pointer",
|
|
11620
|
+
transition: "all 0.14s ease"
|
|
11621
|
+
},
|
|
11622
|
+
children: [
|
|
11623
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11624
|
+
"input",
|
|
11625
|
+
{
|
|
11626
|
+
ref: fileInputRef,
|
|
11627
|
+
type: "file",
|
|
11628
|
+
accept: ".json,application/json",
|
|
11629
|
+
style: { display: "none" },
|
|
11630
|
+
onChange: (e) => {
|
|
11631
|
+
const f = e.target.files?.[0];
|
|
11632
|
+
if (f) parseFile(f);
|
|
11633
|
+
e.target.value = "";
|
|
11634
|
+
}
|
|
11635
|
+
}
|
|
11636
|
+
),
|
|
11637
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11638
|
+
index.MaterialIcon,
|
|
11639
|
+
{
|
|
11640
|
+
name: "folder_open",
|
|
11641
|
+
size: 28,
|
|
11642
|
+
color: dragOver ? "#2563eb" : "#64748b"
|
|
11643
|
+
}
|
|
11644
|
+
),
|
|
11645
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12.5, fontWeight: 700, color: "#0f172a", marginTop: 6 }, children: fileName ? `${tr ? "Seçilen Dosya:" : "Selected File:"} ${fileName}` : tr ? ".ci-survey.json dosyasını buraya sürükleyin veya seçmek için tıklayın" : "Drop a .ci-survey.json package here or click to browse" }),
|
|
11646
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 11, color: "#64748b", marginTop: 3 }, children: tr ? "Tekil anket veya çoklu anket yedek paketlerini (Sadece Yapı / Yapı + Veri) destekler." : "Supports both single-survey and multi-survey bundles (Structure-only or Full Backup)." })
|
|
11647
|
+
]
|
|
11648
|
+
}
|
|
11649
|
+
),
|
|
11650
|
+
summary && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11651
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11652
|
+
"div",
|
|
11653
|
+
{
|
|
11654
|
+
style: {
|
|
11655
|
+
padding: 12,
|
|
11656
|
+
borderRadius: 9,
|
|
11657
|
+
background: "#f8fafc",
|
|
11658
|
+
border: "1px solid #cbd5e1",
|
|
11659
|
+
display: "flex",
|
|
11660
|
+
flexDirection: "column",
|
|
11661
|
+
gap: 8
|
|
11662
|
+
},
|
|
11663
|
+
children: [
|
|
11664
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11665
|
+
"div",
|
|
11666
|
+
{
|
|
11667
|
+
style: {
|
|
11668
|
+
display: "flex",
|
|
11669
|
+
alignItems: "center",
|
|
11670
|
+
justifyContent: "space-between",
|
|
11671
|
+
flexWrap: "wrap",
|
|
11672
|
+
gap: 6
|
|
11673
|
+
},
|
|
11674
|
+
children: [
|
|
11675
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 12, fontWeight: 800, color: "#0f172a" }, children: tr ? "Paket Ön İzlemesi" : "Package Summary" }),
|
|
11676
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11677
|
+
"span",
|
|
11678
|
+
{
|
|
11679
|
+
style: {
|
|
11680
|
+
padding: "2px 8px",
|
|
11681
|
+
borderRadius: 10,
|
|
11682
|
+
fontSize: 10.5,
|
|
11683
|
+
fontWeight: 800,
|
|
11684
|
+
background: summary.totalResponses > 0 ? "#dcfce7" : "#dbeafe",
|
|
11685
|
+
color: summary.totalResponses > 0 ? "#166534" : "#1e40af"
|
|
11686
|
+
},
|
|
11687
|
+
children: summary.totalResponses > 0 ? tr ? `YAPI + ${summary.totalResponses} YANIT` : `STRUCTURE + ${summary.totalResponses} RESPONSES` : tr ? "SADECE YAPI (ŞEMA)" : "STRUCTURE ONLY"
|
|
11688
|
+
}
|
|
11689
|
+
)
|
|
11690
|
+
]
|
|
11691
|
+
}
|
|
11692
|
+
),
|
|
11693
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11694
|
+
"div",
|
|
11695
|
+
{
|
|
11696
|
+
style: {
|
|
11697
|
+
display: "flex",
|
|
11698
|
+
flexDirection: "column",
|
|
11699
|
+
gap: 5,
|
|
11700
|
+
maxHeight: 150,
|
|
11701
|
+
overflowY: "auto"
|
|
11702
|
+
},
|
|
11703
|
+
children: summary.surveys.map((s, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11704
|
+
"div",
|
|
11705
|
+
{
|
|
11706
|
+
style: {
|
|
11707
|
+
padding: "7px 10px",
|
|
11708
|
+
borderRadius: 7,
|
|
11709
|
+
background: "#ffffff",
|
|
11710
|
+
border: "1px solid #e2e8f0",
|
|
11711
|
+
display: "flex",
|
|
11712
|
+
alignItems: "center",
|
|
11713
|
+
justifyContent: "space-between",
|
|
11714
|
+
gap: 8,
|
|
11715
|
+
fontSize: 11.5
|
|
11716
|
+
},
|
|
11717
|
+
children: [
|
|
11718
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 0 }, children: [
|
|
11719
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 700, color: "#0f172a" }, children: s.title }),
|
|
11720
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 10.5, color: "#64748b" }, children: [
|
|
11721
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: s.slug }),
|
|
11722
|
+
" • ",
|
|
11723
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: s.displayMode }),
|
|
11724
|
+
" •",
|
|
11725
|
+
" ",
|
|
11726
|
+
s.stepCount > 0 ? `${s.stepCount} ${tr ? "adım, " : "steps, "}` : "",
|
|
11727
|
+
s.questionCount,
|
|
11728
|
+
" ",
|
|
11729
|
+
tr ? "soru" : "Qs",
|
|
11730
|
+
" •",
|
|
11731
|
+
" ",
|
|
11732
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: s.responseCount }),
|
|
11733
|
+
" ",
|
|
11734
|
+
tr ? "yanıt" : "resp"
|
|
11735
|
+
] })
|
|
11736
|
+
] }),
|
|
11737
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11738
|
+
"span",
|
|
11739
|
+
{
|
|
11740
|
+
style: {
|
|
11741
|
+
flexShrink: 0,
|
|
11742
|
+
padding: "2px 7px",
|
|
11743
|
+
borderRadius: 8,
|
|
11744
|
+
fontSize: 10,
|
|
11745
|
+
fontWeight: 700,
|
|
11746
|
+
background: s.hasConflict ? "#fef3c7" : "#ecfdf5",
|
|
11747
|
+
color: s.hasConflict ? "#92400e" : "#047857"
|
|
11748
|
+
},
|
|
11749
|
+
children: s.hasConflict ? tr ? "Mevcut Slug" : "Slug Exists" : tr ? "Yeni Kayıt" : "New Slug"
|
|
11750
|
+
}
|
|
11751
|
+
)
|
|
11752
|
+
]
|
|
11753
|
+
},
|
|
11754
|
+
`${s.slug}-${idx}`
|
|
11755
|
+
))
|
|
11756
|
+
}
|
|
11757
|
+
)
|
|
11758
|
+
]
|
|
11759
|
+
}
|
|
11760
|
+
),
|
|
11761
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11762
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11763
|
+
"div",
|
|
11764
|
+
{
|
|
11765
|
+
style: {
|
|
11766
|
+
fontSize: 11.5,
|
|
11767
|
+
fontWeight: 700,
|
|
11768
|
+
color: "#334155",
|
|
11769
|
+
marginBottom: 6
|
|
11770
|
+
},
|
|
11771
|
+
children: tr ? "Aynı Slug Mevcutsa Nasıl Davranılsın?" : "Conflict Strategy (When Slug Already Exists)"
|
|
11772
|
+
}
|
|
11773
|
+
),
|
|
11774
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
|
|
11775
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11776
|
+
"button",
|
|
11777
|
+
{
|
|
11778
|
+
type: "button",
|
|
11779
|
+
onClick: () => setConflictStrategy("duplicate"),
|
|
11780
|
+
style: {
|
|
11781
|
+
padding: "9px 10px",
|
|
11782
|
+
borderRadius: 8,
|
|
11783
|
+
border: conflictStrategy === "duplicate" ? "2px solid #2563eb" : "1px solid #cbd5e1",
|
|
11784
|
+
background: conflictStrategy === "duplicate" ? "#eff6ff" : "#ffffff",
|
|
11785
|
+
textAlign: "left",
|
|
11786
|
+
cursor: "pointer"
|
|
11787
|
+
},
|
|
11788
|
+
children: [
|
|
11789
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, fontWeight: 700, color: "#0f172a" }, children: tr ? "Yeni Kopya Oluştur (_copy)" : "Create New Copy (_copy)" }),
|
|
11790
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 10.5, color: "#64748b", marginTop: 2 }, children: tr ? "Mevcut ankete dokunmaz, ayrı bir kopya açar." : "Keeps existing survey untouched; creates unique slug." })
|
|
11791
|
+
]
|
|
11792
|
+
}
|
|
11793
|
+
),
|
|
11794
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11795
|
+
"button",
|
|
11796
|
+
{
|
|
11797
|
+
type: "button",
|
|
11798
|
+
onClick: () => setConflictStrategy("overwrite"),
|
|
11799
|
+
style: {
|
|
11800
|
+
padding: "9px 10px",
|
|
11801
|
+
borderRadius: 8,
|
|
11802
|
+
border: conflictStrategy === "overwrite" ? "2px solid #d97706" : "1px solid #cbd5e1",
|
|
11803
|
+
background: conflictStrategy === "overwrite" ? "#fffbeb" : "#ffffff",
|
|
11804
|
+
textAlign: "left",
|
|
11805
|
+
cursor: "pointer"
|
|
11806
|
+
},
|
|
11807
|
+
children: [
|
|
11808
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, fontWeight: 700, color: "#0f172a" }, children: tr ? "Mevcut Anketin Üzerine Yaz" : "Overwrite Existing Survey" }),
|
|
11809
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 10.5, color: "#64748b", marginTop: 2 }, children: tr ? "Aynı slug varsa yapıyı (ve seçiliyse yanıtları) günceller." : "Updates matching slug in place (and replaces responses if checked)." })
|
|
11810
|
+
]
|
|
11811
|
+
}
|
|
11812
|
+
)
|
|
11813
|
+
] })
|
|
11814
|
+
] }),
|
|
11815
|
+
summary.totalResponses > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11816
|
+
"label",
|
|
11817
|
+
{
|
|
11818
|
+
style: {
|
|
11819
|
+
padding: "10px 12px",
|
|
11820
|
+
borderRadius: 8,
|
|
11821
|
+
background: includeResponses ? "#ecfdf5" : "#f8fafc",
|
|
11822
|
+
border: includeResponses ? "1px solid #10b981" : "1px solid #cbd5e1",
|
|
11823
|
+
display: "flex",
|
|
11824
|
+
alignItems: "center",
|
|
11825
|
+
gap: 9,
|
|
11826
|
+
cursor: "pointer"
|
|
11827
|
+
},
|
|
11828
|
+
children: [
|
|
11829
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11830
|
+
"input",
|
|
11831
|
+
{
|
|
11832
|
+
type: "checkbox",
|
|
11833
|
+
checked: includeResponses,
|
|
11834
|
+
onChange: (e) => setIncludeResponses(e.target.checked)
|
|
11835
|
+
}
|
|
11836
|
+
),
|
|
11837
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11838
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, fontWeight: 700, color: "#0f172a" }, children: tr ? `Paketteki ${summary.totalResponses} Yanıt Verisini de İçe Aktar` : `Also Import ${summary.totalResponses} Recorded Responses` }),
|
|
11839
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 10.5, color: "#475569" }, children: tr ? "İşareti kaldırırsanız bu tam yedek yalnızca temiz şema (0 yanıt) olarak kurulur." : "Uncheck to import only the clean survey schema with 0 responses." })
|
|
11840
|
+
] })
|
|
11841
|
+
]
|
|
11842
|
+
}
|
|
11843
|
+
)
|
|
11844
|
+
] }),
|
|
11845
|
+
errorMsg && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11846
|
+
"div",
|
|
11847
|
+
{
|
|
11848
|
+
style: {
|
|
11849
|
+
padding: "8px 12px",
|
|
11850
|
+
borderRadius: 7,
|
|
11851
|
+
background: "#fee2e2",
|
|
11852
|
+
color: "#991b1b",
|
|
11853
|
+
fontSize: 11.5,
|
|
11854
|
+
fontWeight: 600
|
|
11855
|
+
},
|
|
11856
|
+
children: errorMsg
|
|
11857
|
+
}
|
|
11858
|
+
),
|
|
11859
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8 }, children: [
|
|
11860
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11861
|
+
"button",
|
|
11862
|
+
{
|
|
11863
|
+
type: "button",
|
|
11864
|
+
onClick: onClose,
|
|
11865
|
+
style: {
|
|
11866
|
+
padding: "8px 14px",
|
|
11867
|
+
borderRadius: 7,
|
|
11868
|
+
border: "1px solid #cbd5e1",
|
|
11869
|
+
background: "#ffffff",
|
|
11870
|
+
color: "#334155",
|
|
11871
|
+
fontSize: 12,
|
|
11872
|
+
fontWeight: 600,
|
|
11873
|
+
cursor: "pointer"
|
|
11874
|
+
},
|
|
11875
|
+
children: tr ? "Vazgeç" : "Cancel"
|
|
11876
|
+
}
|
|
11877
|
+
),
|
|
11878
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11879
|
+
"button",
|
|
11880
|
+
{
|
|
11881
|
+
type: "button",
|
|
11882
|
+
disabled: !summary || importing,
|
|
11883
|
+
onClick: handleImport,
|
|
11884
|
+
style: {
|
|
11885
|
+
padding: "8px 16px",
|
|
11886
|
+
borderRadius: 7,
|
|
11887
|
+
border: "none",
|
|
11888
|
+
background: !summary ? "#94a3b8" : "#2563eb",
|
|
11889
|
+
color: "#ffffff",
|
|
11890
|
+
fontSize: 12,
|
|
11891
|
+
fontWeight: 700,
|
|
11892
|
+
cursor: !summary ? "not-allowed" : "pointer",
|
|
11893
|
+
display: "inline-flex",
|
|
11894
|
+
alignItems: "center",
|
|
11895
|
+
gap: 6
|
|
11896
|
+
},
|
|
11897
|
+
children: [
|
|
11898
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "publish", size: 16, color: "#fff" }),
|
|
11899
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: importing ? tr ? "İçe Aktarılıyor..." : "Importing..." : tr ? "Anketi Canlandır / İçe Aktar" : "Import Survey Package" })
|
|
11900
|
+
]
|
|
11901
|
+
}
|
|
11902
|
+
)
|
|
11903
|
+
] })
|
|
11904
|
+
]
|
|
11905
|
+
}
|
|
11906
|
+
)
|
|
11907
|
+
]
|
|
11908
|
+
}
|
|
11909
|
+
)
|
|
11910
|
+
}
|
|
11911
|
+
),
|
|
11912
|
+
document.body
|
|
11913
|
+
);
|
|
11914
|
+
};
|
|
11915
|
+
const SurveyCleanupConfirmModal = ({
|
|
11916
|
+
open,
|
|
11917
|
+
action,
|
|
11918
|
+
uiLocale = "en",
|
|
11919
|
+
targetSurvey,
|
|
11920
|
+
onClose,
|
|
11921
|
+
onCompleted
|
|
11922
|
+
}) => {
|
|
11923
|
+
const tr = uiLocale === "tr";
|
|
11924
|
+
const { post, del } = admin.useFetchClient();
|
|
11925
|
+
const [busy, setBusy] = React.useState(false);
|
|
11926
|
+
const [errorMsg, setErrorMsg] = React.useState("");
|
|
11927
|
+
React__default.default.useEffect(() => {
|
|
11928
|
+
if (open) {
|
|
11929
|
+
setErrorMsg("");
|
|
11930
|
+
}
|
|
11931
|
+
}, [open, action]);
|
|
11932
|
+
if (!open || !action || typeof document === "undefined") return null;
|
|
11933
|
+
const isPurgeDemo = action === "purge-demo";
|
|
11934
|
+
const isClearResp = action === "clear-responses";
|
|
11935
|
+
const respCount = targetSurvey?.responseCount ?? 0;
|
|
11936
|
+
const titleText = isPurgeDemo ? tr ? "Örnek (Dummy) Verileri Temizle" : "Purge Built-in Demo / Dummy Data" : isClearResp ? tr ? "Anket Yanıtlarını Sıfırla (Yapıyı Koru)" : "Clear Survey Responses (Keep Structure)" : tr ? "Anketi ve Yanıtlarını Kalıcı Olarak Sil" : "Delete Survey & All Responses";
|
|
11937
|
+
const bodyText = isPurgeDemo ? tr ? "Yalnızca eklentiyle gelen yerleşik vitrin verileri (showcase_dx_survey, showcase_roadmap_poll, showcase_visual_theme_poll + 525 örnek yanıt ve showcase_contact_form + 20 örnek form başvurusu) silinecektir. Sizin oluşturduğunuz özel anketlere ve formlara dokunulmaz. Ayrıca kalıcı koruma bayrağı işaretlendiği için sayfa yenilendiğinde veya sunucu yeniden başladığında dummy veriler kendiliğinden geri gelmez." : "Deletes ONLY the built-in showcase items (showcase_dx_survey, showcase_roadmap_poll, showcase_visual_theme_poll + sample responses and showcase_contact_form + sample submissions). Your custom surveys and forms remain untouched, and a persistent guard prevents demo data from auto-seeding again on reload or server restart." : isClearResp ? tr ? `"${targetSurvey?.title || ""}" (${targetSurvey?.slug || ""}) anketinin tüm adımları, soruları ve ayarları korunacak; yalnızca mevcut ${respCount} katılımcı yanıtı sıfırlanacaktır. Yayına çıkmadan önce test oylarını temizlemek için idealdir.` : `All steps, questions, and settings of "${targetSurvey?.title || ""}" (${targetSurvey?.slug || ""}) will be preserved, while its ${respCount} recorded response(s) will be permanently deleted.` : tr ? `"${targetSurvey?.title || ""}" (${targetSurvey?.slug || ""}) anketi ve bağlı ${respCount} katılımcı yanıtı kalıcı olarak silinecektir. İsterseniz silmeden önce Dışa Aktar ile .ci-survey.json yedeği alabilirsiniz.` : `"${targetSurvey?.title || ""}" (${targetSurvey?.slug || ""}) and all ${respCount} associated response(s) will be permanently deleted.`;
|
|
11938
|
+
const confirmLabel = isPurgeDemo ? tr ? "Evet, Dummy Verileri Temizle" : "Yes, Purge Demo Data" : isClearResp ? tr ? "Evet, Yanıtları Sıfırla (0 Yap)" : "Yes, Clear Responses" : tr ? "Evet, Anketi Kalıcı Sil" : "Yes, Delete Survey";
|
|
11939
|
+
const handleConfirm = async () => {
|
|
11940
|
+
setBusy(true);
|
|
11941
|
+
setErrorMsg("");
|
|
11942
|
+
try {
|
|
11943
|
+
if (isPurgeDemo) {
|
|
11944
|
+
const res2 = await post("/content-input/surveys/purge-demo", {});
|
|
11945
|
+
onCompleted("purge-demo", res2?.data);
|
|
11946
|
+
onClose();
|
|
11947
|
+
return;
|
|
11948
|
+
}
|
|
11949
|
+
const idOrSlug = String(
|
|
11950
|
+
targetSurvey?.slug || targetSurvey?.documentId || targetSurvey?.id || ""
|
|
11951
|
+
).trim();
|
|
11952
|
+
if (!idOrSlug) {
|
|
11953
|
+
throw new Error(tr ? "Hedef anket bulunamadı." : "Target survey not found.");
|
|
11954
|
+
}
|
|
11955
|
+
if (isClearResp) {
|
|
11956
|
+
const res2 = await del(
|
|
11957
|
+
`/content-input/surveys/${encodeURIComponent(idOrSlug)}/responses`
|
|
11958
|
+
);
|
|
11959
|
+
onCompleted("clear-responses", res2?.data);
|
|
11960
|
+
onClose();
|
|
11961
|
+
return;
|
|
11962
|
+
}
|
|
11963
|
+
const res = await del(
|
|
11964
|
+
`/content-input/surveys/${encodeURIComponent(idOrSlug)}`
|
|
11965
|
+
);
|
|
11966
|
+
onCompleted("delete-survey", res?.data);
|
|
11967
|
+
onClose();
|
|
11968
|
+
} catch (err) {
|
|
11969
|
+
if (isRouteNotLoadedError(err)) {
|
|
11970
|
+
setErrorMsg(
|
|
11971
|
+
tr ? "Yeni sunucu rotalarının aktif olması için lütfen Strapi sunucusunu (npm run dev) bir kez yeniden başlatın." : "Please restart the Strapi server (npm run dev) once so the new backend routes take effect."
|
|
11972
|
+
);
|
|
11973
|
+
} else {
|
|
11974
|
+
setErrorMsg(
|
|
11975
|
+
err?.response?.data?.error?.message || err?.message || (tr ? "İşlem tamamlanamadı." : "Operation failed.")
|
|
11976
|
+
);
|
|
11977
|
+
}
|
|
11978
|
+
} finally {
|
|
11979
|
+
setBusy(false);
|
|
11980
|
+
}
|
|
11981
|
+
};
|
|
11982
|
+
return ReactDOM.createPortal(
|
|
11983
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11984
|
+
"div",
|
|
11985
|
+
{
|
|
11986
|
+
className: "ci-root",
|
|
11987
|
+
style: {
|
|
11988
|
+
position: "fixed",
|
|
11989
|
+
inset: 0,
|
|
11990
|
+
background: "rgba(15, 23, 42, 0.68)",
|
|
11991
|
+
zIndex: 320,
|
|
11992
|
+
display: "flex",
|
|
11993
|
+
alignItems: "center",
|
|
11994
|
+
justifyContent: "center",
|
|
11995
|
+
padding: 16
|
|
11996
|
+
},
|
|
11997
|
+
onClick: onClose,
|
|
11998
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11999
|
+
"div",
|
|
12000
|
+
{
|
|
12001
|
+
style: {
|
|
12002
|
+
width: "100%",
|
|
12003
|
+
maxWidth: 490,
|
|
12004
|
+
background: "#ffffff",
|
|
12005
|
+
borderRadius: 12,
|
|
12006
|
+
boxShadow: "0 24px 54px rgba(15, 23, 42, 0.4)",
|
|
12007
|
+
overflow: "hidden",
|
|
12008
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"
|
|
12009
|
+
},
|
|
12010
|
+
onClick: (e) => e.stopPropagation(),
|
|
12011
|
+
children: [
|
|
12012
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12013
|
+
"div",
|
|
12014
|
+
{
|
|
12015
|
+
style: {
|
|
12016
|
+
padding: "14px 18px",
|
|
12017
|
+
background: isClearResp ? "#92400e" : "#991b1b",
|
|
12018
|
+
color: "#ffffff",
|
|
12019
|
+
display: "flex",
|
|
12020
|
+
alignItems: "center",
|
|
12021
|
+
justifyContent: "space-between"
|
|
12022
|
+
},
|
|
12023
|
+
children: [
|
|
12024
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12025
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12026
|
+
index.MaterialIcon,
|
|
12027
|
+
{
|
|
12028
|
+
name: isClearResp ? "restart_alt" : "delete_sweep",
|
|
12029
|
+
size: 20,
|
|
12030
|
+
color: "#fde68a"
|
|
12031
|
+
}
|
|
12032
|
+
),
|
|
12033
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 14, fontWeight: 700 }, children: titleText })
|
|
12034
|
+
] }),
|
|
12035
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12036
|
+
"button",
|
|
12037
|
+
{
|
|
12038
|
+
type: "button",
|
|
12039
|
+
onClick: onClose,
|
|
12040
|
+
style: {
|
|
12041
|
+
border: "none",
|
|
12042
|
+
background: "transparent",
|
|
12043
|
+
color: "#fecaca",
|
|
12044
|
+
fontSize: 18,
|
|
12045
|
+
cursor: "pointer"
|
|
12046
|
+
},
|
|
12047
|
+
children: "×"
|
|
12048
|
+
}
|
|
12049
|
+
)
|
|
12050
|
+
]
|
|
12051
|
+
}
|
|
12052
|
+
),
|
|
12053
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: 18, display: "flex", flexDirection: "column", gap: 14 }, children: [
|
|
12054
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12.5, color: "#334155", lineHeight: 1.55 }, children: bodyText }),
|
|
12055
|
+
errorMsg && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12056
|
+
"div",
|
|
12057
|
+
{
|
|
12058
|
+
style: {
|
|
12059
|
+
padding: "8px 12px",
|
|
12060
|
+
borderRadius: 7,
|
|
12061
|
+
background: "#fee2e2",
|
|
12062
|
+
color: "#991b1b",
|
|
12063
|
+
fontSize: 11.5,
|
|
12064
|
+
fontWeight: 600
|
|
12065
|
+
},
|
|
12066
|
+
children: errorMsg
|
|
12067
|
+
}
|
|
12068
|
+
),
|
|
12069
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: 8 }, children: [
|
|
12070
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12071
|
+
"button",
|
|
12072
|
+
{
|
|
12073
|
+
type: "button",
|
|
12074
|
+
onClick: onClose,
|
|
12075
|
+
style: {
|
|
12076
|
+
padding: "8px 14px",
|
|
12077
|
+
borderRadius: 7,
|
|
12078
|
+
border: "1px solid #cbd5e1",
|
|
12079
|
+
background: "#ffffff",
|
|
12080
|
+
color: "#334155",
|
|
12081
|
+
fontSize: 12,
|
|
12082
|
+
fontWeight: 600,
|
|
12083
|
+
cursor: "pointer"
|
|
12084
|
+
},
|
|
12085
|
+
children: tr ? "Vazgeç" : "Cancel"
|
|
12086
|
+
}
|
|
12087
|
+
),
|
|
12088
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12089
|
+
"button",
|
|
12090
|
+
{
|
|
12091
|
+
type: "button",
|
|
12092
|
+
disabled: busy,
|
|
12093
|
+
onClick: handleConfirm,
|
|
12094
|
+
style: {
|
|
12095
|
+
padding: "8px 16px",
|
|
12096
|
+
borderRadius: 7,
|
|
12097
|
+
border: "none",
|
|
12098
|
+
background: isClearResp ? "#d97706" : "#dc2626",
|
|
12099
|
+
color: "#ffffff",
|
|
12100
|
+
fontSize: 12,
|
|
12101
|
+
fontWeight: 700,
|
|
12102
|
+
cursor: "pointer"
|
|
12103
|
+
},
|
|
12104
|
+
children: busy ? "..." : confirmLabel
|
|
12105
|
+
}
|
|
12106
|
+
)
|
|
12107
|
+
] })
|
|
12108
|
+
] })
|
|
12109
|
+
]
|
|
12110
|
+
}
|
|
12111
|
+
)
|
|
12112
|
+
}
|
|
12113
|
+
),
|
|
12114
|
+
document.body
|
|
12115
|
+
);
|
|
12116
|
+
};
|
|
12117
|
+
function normalizeMultiStepDraft(draft) {
|
|
12118
|
+
const rawSteps = Array.isArray(draft.steps) && draft.steps.length > 0 ? draft.steps : [
|
|
12119
|
+
{
|
|
12120
|
+
id: "step_1",
|
|
12121
|
+
title: { tr: "1. Adım", en: "Step 1" }
|
|
12122
|
+
}
|
|
12123
|
+
];
|
|
12124
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
12125
|
+
for (const st of rawSteps) {
|
|
12126
|
+
buckets.set(st.id, []);
|
|
12127
|
+
}
|
|
12128
|
+
const fallbackStepId = rawSteps[0].id;
|
|
12129
|
+
for (const q of draft.questions || []) {
|
|
12130
|
+
if (!q) continue;
|
|
12131
|
+
const validStepId = q.stepId && buckets.has(q.stepId) ? q.stepId : fallbackStepId;
|
|
12132
|
+
buckets.get(validStepId).push({
|
|
12133
|
+
...q,
|
|
12134
|
+
stepId: validStepId
|
|
12135
|
+
});
|
|
12136
|
+
}
|
|
12137
|
+
const orderedQuestions = rawSteps.flatMap((st) => buckets.get(st.id) || []);
|
|
12138
|
+
return {
|
|
12139
|
+
...draft,
|
|
12140
|
+
steps: rawSteps,
|
|
12141
|
+
questions: orderedQuestions
|
|
12142
|
+
};
|
|
12143
|
+
}
|
|
12144
|
+
function groupQuestionsByStep(questions, steps) {
|
|
12145
|
+
const map = /* @__PURE__ */ new Map();
|
|
12146
|
+
for (const st of steps) {
|
|
12147
|
+
map.set(st.id, []);
|
|
12148
|
+
}
|
|
12149
|
+
if (steps.length === 0) return map;
|
|
12150
|
+
const fallbackId = steps[0].id;
|
|
12151
|
+
questions.forEach((q, gIdx) => {
|
|
12152
|
+
const targetId = q.stepId && map.has(q.stepId) ? q.stepId : fallbackId;
|
|
12153
|
+
const list = map.get(targetId);
|
|
12154
|
+
list.push({
|
|
12155
|
+
question: q,
|
|
12156
|
+
globalIndex: gIdx,
|
|
12157
|
+
localIndex: list.length
|
|
12158
|
+
});
|
|
12159
|
+
});
|
|
12160
|
+
return map;
|
|
12161
|
+
}
|
|
12162
|
+
function reorderStepsInDraft(draft, sourceStepId, targetStepId, position = "before") {
|
|
12163
|
+
const normalized = normalizeMultiStepDraft(draft);
|
|
12164
|
+
const steps = normalized.steps || [];
|
|
12165
|
+
if (!sourceStepId || !targetStepId || sourceStepId === targetStepId) {
|
|
12166
|
+
return normalized;
|
|
12167
|
+
}
|
|
12168
|
+
const moving = steps.find((s) => s.id === sourceStepId);
|
|
12169
|
+
const target = steps.find((s) => s.id === targetStepId);
|
|
12170
|
+
if (!moving || !target) return normalized;
|
|
12171
|
+
const remaining = steps.filter((s) => s.id !== sourceStepId);
|
|
12172
|
+
const targetIdx = remaining.findIndex((s) => s.id === targetStepId);
|
|
12173
|
+
const insertAt = position === "after" ? targetIdx + 1 : targetIdx;
|
|
12174
|
+
remaining.splice(Math.max(0, insertAt), 0, moving);
|
|
12175
|
+
return normalizeMultiStepDraft({
|
|
12176
|
+
...normalized,
|
|
12177
|
+
steps: remaining
|
|
12178
|
+
});
|
|
12179
|
+
}
|
|
12180
|
+
function shiftStepByOffset(draft, stepId, delta) {
|
|
12181
|
+
const normalized = normalizeMultiStepDraft(draft);
|
|
12182
|
+
const steps = [...normalized.steps || []];
|
|
12183
|
+
const idx = steps.findIndex((s) => s.id === stepId);
|
|
12184
|
+
if (idx < 0) return normalized;
|
|
12185
|
+
const nextIdx = idx + delta;
|
|
12186
|
+
if (nextIdx < 0 || nextIdx >= steps.length) return normalized;
|
|
12187
|
+
const [moved] = steps.splice(idx, 1);
|
|
12188
|
+
steps.splice(nextIdx, 0, moved);
|
|
12189
|
+
return normalizeMultiStepDraft({
|
|
12190
|
+
...normalized,
|
|
12191
|
+
steps
|
|
12192
|
+
});
|
|
12193
|
+
}
|
|
12194
|
+
function moveQuestionInMultiStepDraft(draft, sourceQuestionKey, target) {
|
|
12195
|
+
const normalized = normalizeMultiStepDraft(draft);
|
|
12196
|
+
const steps = normalized.steps || [];
|
|
12197
|
+
if (steps.length === 0) return normalized;
|
|
12198
|
+
if (target.targetQuestionKey && target.targetQuestionKey === sourceQuestionKey && target.position !== "end") {
|
|
12199
|
+
return normalized;
|
|
12200
|
+
}
|
|
12201
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
12202
|
+
for (const st of steps) {
|
|
12203
|
+
buckets.set(st.id, []);
|
|
12204
|
+
}
|
|
12205
|
+
let movingQuestion = null;
|
|
12206
|
+
for (const q of normalized.questions || []) {
|
|
12207
|
+
if (q.key === sourceQuestionKey && !movingQuestion) {
|
|
12208
|
+
movingQuestion = q;
|
|
12209
|
+
continue;
|
|
12210
|
+
}
|
|
12211
|
+
const sid = q.stepId && buckets.has(q.stepId) ? q.stepId : steps[0].id;
|
|
12212
|
+
buckets.get(sid).push(q);
|
|
12213
|
+
}
|
|
12214
|
+
if (!movingQuestion) return normalized;
|
|
12215
|
+
const destStepId = buckets.has(target.stepId) ? target.stepId : steps[0].id;
|
|
12216
|
+
const updatedQuestion = {
|
|
12217
|
+
...movingQuestion,
|
|
12218
|
+
stepId: destStepId
|
|
12219
|
+
};
|
|
12220
|
+
const destBucket = buckets.get(destStepId);
|
|
12221
|
+
if (!target.targetQuestionKey || target.position === "end") {
|
|
12222
|
+
destBucket.push(updatedQuestion);
|
|
12223
|
+
} else {
|
|
12224
|
+
const tIdx = destBucket.findIndex((q) => q.key === target.targetQuestionKey);
|
|
12225
|
+
if (tIdx < 0) {
|
|
12226
|
+
destBucket.push(updatedQuestion);
|
|
12227
|
+
} else {
|
|
12228
|
+
const insertIdx = target.position === "after" ? tIdx + 1 : tIdx;
|
|
12229
|
+
destBucket.splice(insertIdx, 0, updatedQuestion);
|
|
12230
|
+
}
|
|
12231
|
+
}
|
|
12232
|
+
return {
|
|
12233
|
+
...normalized,
|
|
12234
|
+
questions: steps.flatMap((st) => buckets.get(st.id) || [])
|
|
12235
|
+
};
|
|
12236
|
+
}
|
|
12237
|
+
function insertQuestionInMultiStepDraft(draft, newQuestion, target) {
|
|
12238
|
+
const normalized = normalizeMultiStepDraft(draft);
|
|
12239
|
+
const steps = normalized.steps || [];
|
|
12240
|
+
const destStepId = steps.some((s) => s.id === target.stepId) ? target.stepId : steps[0].id;
|
|
12241
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
12242
|
+
for (const st of steps) {
|
|
12243
|
+
buckets.set(st.id, []);
|
|
12244
|
+
}
|
|
12245
|
+
for (const q of normalized.questions || []) {
|
|
12246
|
+
const sid = q.stepId && buckets.has(q.stepId) ? q.stepId : steps[0].id;
|
|
12247
|
+
buckets.get(sid).push(q);
|
|
12248
|
+
}
|
|
12249
|
+
const prepared = {
|
|
12250
|
+
...newQuestion,
|
|
12251
|
+
stepId: destStepId
|
|
12252
|
+
};
|
|
12253
|
+
const destBucket = buckets.get(destStepId);
|
|
12254
|
+
if (!target.targetQuestionKey || target.position === "end") {
|
|
12255
|
+
destBucket.push(prepared);
|
|
12256
|
+
} else {
|
|
12257
|
+
const tIdx = destBucket.findIndex((q) => q.key === target.targetQuestionKey);
|
|
12258
|
+
if (tIdx < 0) {
|
|
12259
|
+
destBucket.push(prepared);
|
|
12260
|
+
} else {
|
|
12261
|
+
const insertIdx = target.position === "after" ? tIdx + 1 : tIdx;
|
|
12262
|
+
destBucket.splice(insertIdx, 0, prepared);
|
|
12263
|
+
}
|
|
12264
|
+
}
|
|
12265
|
+
const nextQuestions = steps.flatMap((st) => buckets.get(st.id) || []);
|
|
12266
|
+
const insertedIndex = Math.max(
|
|
12267
|
+
0,
|
|
12268
|
+
nextQuestions.findIndex((q) => q.key === prepared.key)
|
|
12269
|
+
);
|
|
12270
|
+
return {
|
|
12271
|
+
draft: {
|
|
12272
|
+
...normalized,
|
|
12273
|
+
questions: nextQuestions
|
|
12274
|
+
},
|
|
12275
|
+
insertedIndex
|
|
12276
|
+
};
|
|
12277
|
+
}
|
|
12278
|
+
function reorderFlatQuestions(questions, sourceKey, targetKey, position = "before") {
|
|
12279
|
+
if (!sourceKey || !targetKey || sourceKey === targetKey) return questions;
|
|
12280
|
+
const moving = questions.find((q) => q.key === sourceKey);
|
|
12281
|
+
if (!moving) return questions;
|
|
12282
|
+
const remaining = questions.filter((q) => q.key !== sourceKey);
|
|
12283
|
+
const tIdx = remaining.findIndex((q) => q.key === targetKey);
|
|
12284
|
+
if (tIdx < 0) return questions;
|
|
12285
|
+
const insertIdx = position === "after" ? tIdx + 1 : tIdx;
|
|
12286
|
+
remaining.splice(insertIdx, 0, moving);
|
|
12287
|
+
return remaining;
|
|
12288
|
+
}
|
|
12289
|
+
function deleteStepWithQuestionReassignment(draft, stepIdToDelete) {
|
|
12290
|
+
const normalized = normalizeMultiStepDraft(draft);
|
|
12291
|
+
const steps = normalized.steps || [];
|
|
12292
|
+
if (steps.length <= 1) {
|
|
12293
|
+
return {
|
|
12294
|
+
draft: normalized,
|
|
12295
|
+
fallbackStepId: steps[0]?.id || "step_1",
|
|
12296
|
+
movedQuestionCount: 0
|
|
12297
|
+
};
|
|
12298
|
+
}
|
|
12299
|
+
const delIdx = steps.findIndex((s) => s.id === stepIdToDelete);
|
|
12300
|
+
if (delIdx < 0) {
|
|
12301
|
+
return {
|
|
12302
|
+
draft: normalized,
|
|
12303
|
+
fallbackStepId: steps[0].id,
|
|
12304
|
+
movedQuestionCount: 0
|
|
12305
|
+
};
|
|
12306
|
+
}
|
|
12307
|
+
const fallbackStep = delIdx > 0 ? steps[delIdx - 1] : steps[1];
|
|
12308
|
+
let movedQuestionCount = 0;
|
|
12309
|
+
const updatedQuestions = (normalized.questions || []).map((q) => {
|
|
12310
|
+
if (q.stepId === stepIdToDelete) {
|
|
12311
|
+
movedQuestionCount += 1;
|
|
12312
|
+
return { ...q, stepId: fallbackStep.id };
|
|
12313
|
+
}
|
|
12314
|
+
return q;
|
|
12315
|
+
});
|
|
12316
|
+
const remainingSteps = steps.filter((s) => s.id !== stepIdToDelete);
|
|
12317
|
+
const nextDraft = normalizeMultiStepDraft({
|
|
12318
|
+
...normalized,
|
|
12319
|
+
steps: remainingSteps,
|
|
12320
|
+
questions: updatedQuestions
|
|
12321
|
+
});
|
|
12322
|
+
return {
|
|
12323
|
+
draft: nextDraft,
|
|
12324
|
+
fallbackStepId: fallbackStep.id,
|
|
12325
|
+
movedQuestionCount
|
|
12326
|
+
};
|
|
12327
|
+
}
|
|
10893
12328
|
const inputStyle = {
|
|
10894
12329
|
width: "100%",
|
|
10895
12330
|
padding: "6px 9px",
|
|
@@ -11156,27 +12591,61 @@ const SurveyStudioModal = ({
|
|
|
11156
12591
|
const { post } = admin.useFetchClient();
|
|
11157
12592
|
const { locales: strapiLocales } = useStrapiLocales();
|
|
11158
12593
|
const [tab, setTab] = React.useState(initialTab);
|
|
11159
|
-
const [draft, setDraft] = React.useState(
|
|
11160
|
-
|
|
11161
|
-
|
|
12594
|
+
const [draft, setDraft] = React.useState(() => {
|
|
12595
|
+
const cloned = JSON.parse(JSON.stringify(initialSurvey));
|
|
12596
|
+
return cloned.displayMode === "multi_step" ? normalizeMultiStepDraft(cloned) : cloned;
|
|
12597
|
+
});
|
|
11162
12598
|
const [selectedQuestionIdx, setSelectedQuestionIdx] = React.useState(0);
|
|
12599
|
+
const [collapsedStepIds, setCollapsedStepIds] = React.useState({});
|
|
12600
|
+
const [openStepDescIds, setOpenStepDescIds] = React.useState({});
|
|
12601
|
+
const [activeStepId, setActiveStepId] = React.useState(
|
|
12602
|
+
() => initialSurvey.steps?.[0]?.id || "step_1"
|
|
12603
|
+
);
|
|
12604
|
+
const [stepDragReadyId, setStepDragReadyId] = React.useState(null);
|
|
12605
|
+
const [dropIndicator, setDropIndicator] = React.useState(null);
|
|
11163
12606
|
const [saving, setSaving] = React.useState(false);
|
|
11164
12607
|
const [statusMsg, setStatusMsg] = React.useState("");
|
|
11165
12608
|
const [optDragReadyIdx, setOptDragReadyIdx] = React.useState(null);
|
|
12609
|
+
const [studioExportOpen, setStudioExportOpen] = React.useState(false);
|
|
12610
|
+
const [studioImportOpen, setStudioImportOpen] = React.useState(false);
|
|
12611
|
+
const [studioCleanupAction, setStudioCleanupAction] = React.useState(null);
|
|
12612
|
+
const [studioAnalyticsKey, setStudioAnalyticsKey] = React.useState(0);
|
|
11166
12613
|
const dragRef = React.useRef(null);
|
|
12614
|
+
const hoverExpandTimerRef = React.useRef(null);
|
|
12615
|
+
const clearHoverExpandTimer = () => {
|
|
12616
|
+
if (hoverExpandTimerRef.current) {
|
|
12617
|
+
clearTimeout(hoverExpandTimerRef.current.timer);
|
|
12618
|
+
hoverExpandTimerRef.current = null;
|
|
12619
|
+
}
|
|
12620
|
+
};
|
|
11167
12621
|
React.useEffect(() => {
|
|
11168
12622
|
if (open) {
|
|
11169
|
-
|
|
12623
|
+
const cloned = JSON.parse(JSON.stringify(initialSurvey));
|
|
12624
|
+
const nextDraft = cloned.displayMode === "multi_step" ? normalizeMultiStepDraft(cloned) : cloned;
|
|
12625
|
+
setDraft(nextDraft);
|
|
11170
12626
|
setSelectedQuestionIdx(0);
|
|
12627
|
+
setCollapsedStepIds({});
|
|
12628
|
+
setOpenStepDescIds({});
|
|
12629
|
+
setActiveStepId(nextDraft.steps?.[0]?.id || "step_1");
|
|
12630
|
+
setDropIndicator(null);
|
|
12631
|
+
setStepDragReadyId(null);
|
|
11171
12632
|
setTab(initialTab);
|
|
11172
12633
|
setStatusMsg("");
|
|
11173
12634
|
}
|
|
12635
|
+
return () => clearHoverExpandTimer();
|
|
11174
12636
|
}, [open, initialSurvey, initialTab]);
|
|
11175
12637
|
if (!open || typeof document === "undefined") return null;
|
|
11176
12638
|
const questions = Array.isArray(draft.questions) ? draft.questions : [];
|
|
11177
12639
|
const activeQ = questions[selectedQuestionIdx] || questions[0] || null;
|
|
11178
12640
|
const steps = Array.isArray(draft.steps) ? draft.steps : [];
|
|
11179
12641
|
const localeGridCols = `repeat(${Math.min(Math.max(strapiLocales.length, 1), 3)}, 1fr)`;
|
|
12642
|
+
const selectQuestionByKey = (nextQuestions, key) => {
|
|
12643
|
+
if (!key) return;
|
|
12644
|
+
const foundIdx = nextQuestions.findIndex((q) => q.key === key);
|
|
12645
|
+
if (foundIdx >= 0) {
|
|
12646
|
+
setSelectedQuestionIdx(foundIdx);
|
|
12647
|
+
}
|
|
12648
|
+
};
|
|
11180
12649
|
const updateActiveQuestion = (patch) => {
|
|
11181
12650
|
if (!activeQ) return;
|
|
11182
12651
|
setDraft((prev) => ({
|
|
@@ -11186,11 +12655,27 @@ const SurveyStudioModal = ({
|
|
|
11186
12655
|
)
|
|
11187
12656
|
}));
|
|
11188
12657
|
};
|
|
11189
|
-
const addQuestionOfType = (qType, insertAt) => {
|
|
11190
|
-
|
|
12658
|
+
const addQuestionOfType = (qType, insertAt, explicitStepId) => {
|
|
12659
|
+
if (draft.displayMode === "multi_step") {
|
|
12660
|
+
const targetStepId = explicitStepId || (activeStepId && steps.some((s) => s.id === activeStepId) ? activeStepId : void 0) || (activeQ?.stepId && steps.some((s) => s.id === activeQ.stepId) ? activeQ.stepId : void 0) || steps[0]?.id || "step_1";
|
|
12661
|
+
const newQ2 = buildQuestionFromType(
|
|
12662
|
+
qType,
|
|
12663
|
+
targetStepId,
|
|
12664
|
+
questions.map((q) => q.key)
|
|
12665
|
+
);
|
|
12666
|
+
const { draft: nextDraft, insertedIndex } = insertQuestionInMultiStepDraft(draft, newQ2, {
|
|
12667
|
+
stepId: targetStepId,
|
|
12668
|
+
position: "end"
|
|
12669
|
+
});
|
|
12670
|
+
setDraft(nextDraft);
|
|
12671
|
+
setSelectedQuestionIdx(insertedIndex);
|
|
12672
|
+
setActiveStepId(targetStepId);
|
|
12673
|
+
setCollapsedStepIds((prev) => ({ ...prev, [targetStepId]: false }));
|
|
12674
|
+
return;
|
|
12675
|
+
}
|
|
11191
12676
|
const newQ = buildQuestionFromType(
|
|
11192
12677
|
qType,
|
|
11193
|
-
|
|
12678
|
+
void 0,
|
|
11194
12679
|
questions.map((q) => q.key)
|
|
11195
12680
|
);
|
|
11196
12681
|
const nextList = [...questions];
|
|
@@ -11334,6 +12819,81 @@ const SurveyStudioModal = ({
|
|
|
11334
12819
|
children: statusMsg
|
|
11335
12820
|
}
|
|
11336
12821
|
),
|
|
12822
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12823
|
+
"button",
|
|
12824
|
+
{
|
|
12825
|
+
type: "button",
|
|
12826
|
+
onClick: () => setStudioImportOpen(true),
|
|
12827
|
+
title: tr ? ".ci-survey.json paketinden anket içe aktar" : "Import survey from .ci-survey.json bundle",
|
|
12828
|
+
style: {
|
|
12829
|
+
padding: "7px 11px",
|
|
12830
|
+
borderRadius: 6,
|
|
12831
|
+
border: "1px solid rgba(56, 189, 248, 0.45)",
|
|
12832
|
+
background: "rgba(14, 165, 233, 0.16)",
|
|
12833
|
+
color: "#e0f2fe",
|
|
12834
|
+
fontSize: 11.5,
|
|
12835
|
+
fontWeight: 700,
|
|
12836
|
+
cursor: "pointer",
|
|
12837
|
+
display: "inline-flex",
|
|
12838
|
+
alignItems: "center",
|
|
12839
|
+
gap: 5
|
|
12840
|
+
},
|
|
12841
|
+
children: [
|
|
12842
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "upload_file", size: 15, color: "#7dd3fc" }),
|
|
12843
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "İçe Aktar" : "Import" })
|
|
12844
|
+
]
|
|
12845
|
+
}
|
|
12846
|
+
),
|
|
12847
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12848
|
+
"button",
|
|
12849
|
+
{
|
|
12850
|
+
type: "button",
|
|
12851
|
+
onClick: () => setStudioExportOpen(true),
|
|
12852
|
+
title: tr ? "Bu anketi Sadece Yapı veya Yapı + Veri olarak .ci-survey.json indir" : "Export this survey as Structure or Full Backup (.ci-survey.json)",
|
|
12853
|
+
style: {
|
|
12854
|
+
padding: "7px 11px",
|
|
12855
|
+
borderRadius: 6,
|
|
12856
|
+
border: "1px solid rgba(52, 211, 153, 0.45)",
|
|
12857
|
+
background: "rgba(16, 185, 129, 0.16)",
|
|
12858
|
+
color: "#d1fae5",
|
|
12859
|
+
fontSize: 11.5,
|
|
12860
|
+
fontWeight: 700,
|
|
12861
|
+
cursor: "pointer",
|
|
12862
|
+
display: "inline-flex",
|
|
12863
|
+
alignItems: "center",
|
|
12864
|
+
gap: 5
|
|
12865
|
+
},
|
|
12866
|
+
children: [
|
|
12867
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "download", size: 15, color: "#6ee7b7" }),
|
|
12868
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Dışa Aktar" : "Export" })
|
|
12869
|
+
]
|
|
12870
|
+
}
|
|
12871
|
+
),
|
|
12872
|
+
Boolean(draft.id || draft.documentId || draft._id) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12873
|
+
"button",
|
|
12874
|
+
{
|
|
12875
|
+
type: "button",
|
|
12876
|
+
onClick: () => setStudioCleanupAction("clear-responses"),
|
|
12877
|
+
title: tr ? "Anket yapısını koruyarak mevcut yanıtları sıfırlar (0 yapar)" : "Clear all recorded responses while keeping survey structure",
|
|
12878
|
+
style: {
|
|
12879
|
+
padding: "7px 10px",
|
|
12880
|
+
borderRadius: 6,
|
|
12881
|
+
border: "1px solid rgba(251, 191, 36, 0.45)",
|
|
12882
|
+
background: "rgba(217, 119, 6, 0.18)",
|
|
12883
|
+
color: "#fef3c7",
|
|
12884
|
+
fontSize: 11.5,
|
|
12885
|
+
fontWeight: 700,
|
|
12886
|
+
cursor: "pointer",
|
|
12887
|
+
display: "inline-flex",
|
|
12888
|
+
alignItems: "center",
|
|
12889
|
+
gap: 5
|
|
12890
|
+
},
|
|
12891
|
+
children: [
|
|
12892
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "restart_alt", size: 15, color: "#fcd34d" }),
|
|
12893
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Yanıt 0'la" : "Reset Resp" })
|
|
12894
|
+
]
|
|
12895
|
+
}
|
|
12896
|
+
),
|
|
11337
12897
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11338
12898
|
"button",
|
|
11339
12899
|
{
|
|
@@ -11544,167 +13104,35 @@ const SurveyStudioModal = ({
|
|
|
11544
13104
|
"button",
|
|
11545
13105
|
{
|
|
11546
13106
|
type: "button",
|
|
11547
|
-
onClick: () =>
|
|
11548
|
-
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
borderRadius: 6,
|
|
11560
|
-
border: active ? "1.5px solid #2563eb" : "1px solid #cbd5e1",
|
|
11561
|
-
background: active ? "#eff6ff" : "#f8fafc",
|
|
11562
|
-
color: active ? "#1d4ed8" : "#334155",
|
|
11563
|
-
fontSize: 11,
|
|
11564
|
-
fontWeight: 700,
|
|
11565
|
-
cursor: "pointer"
|
|
11566
|
-
},
|
|
11567
|
-
children: tr ? m.tr : m.en
|
|
11568
|
-
},
|
|
11569
|
-
m.id
|
|
11570
|
-
);
|
|
11571
|
-
}) })
|
|
11572
|
-
]
|
|
11573
|
-
}
|
|
11574
|
-
),
|
|
11575
|
-
draft.displayMode === "multi_step" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11576
|
-
"div",
|
|
11577
|
-
{
|
|
11578
|
-
style: {
|
|
11579
|
-
padding: 10,
|
|
11580
|
-
borderRadius: 8,
|
|
11581
|
-
background: "#ffffff",
|
|
11582
|
-
border: "1px solid #cbd5e1"
|
|
11583
|
-
},
|
|
11584
|
-
children: [
|
|
11585
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11586
|
-
"div",
|
|
11587
|
-
{
|
|
11588
|
-
style: {
|
|
11589
|
-
display: "flex",
|
|
11590
|
-
alignItems: "center",
|
|
11591
|
-
justifyContent: "space-between",
|
|
11592
|
-
marginBottom: 8
|
|
11593
|
-
},
|
|
11594
|
-
children: [
|
|
11595
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11, fontWeight: 700, color: "#1e3a8a" }, children: tr ? "Sihirbaz Adımları (Steps)" : "Wizard Steps" }),
|
|
11596
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11597
|
-
"button",
|
|
11598
|
-
{
|
|
11599
|
-
type: "button",
|
|
11600
|
-
onClick: () => {
|
|
11601
|
-
const nextIdx = steps.length + 1;
|
|
11602
|
-
setDraft((prev) => ({
|
|
11603
|
-
...prev,
|
|
11604
|
-
steps: [
|
|
11605
|
-
...prev.steps || [],
|
|
11606
|
-
{
|
|
11607
|
-
id: `step_${uid("s")}`,
|
|
11608
|
-
title: { tr: `${nextIdx}. Adım`, en: `Step ${nextIdx}` }
|
|
11609
|
-
}
|
|
11610
|
-
]
|
|
11611
|
-
}));
|
|
11612
|
-
},
|
|
11613
|
-
style: {
|
|
11614
|
-
padding: "3px 8px",
|
|
11615
|
-
fontSize: 10,
|
|
11616
|
-
fontWeight: 700,
|
|
11617
|
-
borderRadius: 4,
|
|
11618
|
-
border: "1px solid #93c5fd",
|
|
11619
|
-
background: "#eff6ff",
|
|
11620
|
-
color: "#1d4ed8",
|
|
11621
|
-
cursor: "pointer"
|
|
11622
|
-
},
|
|
11623
|
-
children: tr ? "+ Adım Ekle" : "+ Add Step"
|
|
11624
|
-
}
|
|
11625
|
-
)
|
|
11626
|
-
]
|
|
11627
|
-
}
|
|
11628
|
-
),
|
|
11629
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: steps.map((st, sIdx) => {
|
|
11630
|
-
const stTitleObj = normalizeLocalizedRecord(st.title, strapiLocales);
|
|
11631
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11632
|
-
"div",
|
|
11633
|
-
{
|
|
11634
|
-
draggable: true,
|
|
11635
|
-
onDragStart: () => {
|
|
11636
|
-
dragRef.current = { kind: "step", index: sIdx };
|
|
11637
|
-
},
|
|
11638
|
-
onDragOver: (e) => {
|
|
11639
|
-
if (dragRef.current?.kind === "step") e.preventDefault();
|
|
11640
|
-
},
|
|
11641
|
-
onDrop: (e) => {
|
|
11642
|
-
e.preventDefault();
|
|
11643
|
-
if (dragRef.current?.kind !== "step") return;
|
|
11644
|
-
const from = dragRef.current.index;
|
|
11645
|
-
dragRef.current = null;
|
|
11646
|
-
if (from === sIdx) return;
|
|
11647
|
-
const copy = [...steps];
|
|
11648
|
-
const [moved] = copy.splice(from, 1);
|
|
11649
|
-
copy.splice(sIdx, 0, moved);
|
|
11650
|
-
setDraft((prev) => ({ ...prev, steps: copy }));
|
|
11651
|
-
},
|
|
11652
|
-
style: {
|
|
11653
|
-
display: "grid",
|
|
11654
|
-
gridTemplateColumns: `20px repeat(${strapiLocales.length}, 1fr) 22px`,
|
|
11655
|
-
gap: 5,
|
|
11656
|
-
alignItems: "center",
|
|
11657
|
-
padding: "4px 6px",
|
|
11658
|
-
borderRadius: 5,
|
|
11659
|
-
background: "#f8fafc",
|
|
11660
|
-
border: "1px solid #e2e8f0"
|
|
11661
|
-
},
|
|
11662
|
-
children: [
|
|
11663
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "drag_indicator", size: 14, color: "#64748b" }),
|
|
11664
|
-
strapiLocales.map((loc) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11665
|
-
"input",
|
|
11666
|
-
{
|
|
11667
|
-
type: "text",
|
|
11668
|
-
value: stTitleObj[loc.code] || "",
|
|
11669
|
-
onChange: (e) => {
|
|
11670
|
-
const nextSteps = steps.map(
|
|
11671
|
-
(item, i) => i === sIdx ? {
|
|
11672
|
-
...item,
|
|
11673
|
-
title: {
|
|
11674
|
-
...stTitleObj,
|
|
11675
|
-
[loc.code]: e.target.value
|
|
11676
|
-
}
|
|
11677
|
-
} : item
|
|
11678
|
-
);
|
|
11679
|
-
setDraft((prev) => ({ ...prev, steps: nextSteps }));
|
|
11680
|
-
},
|
|
11681
|
-
placeholder: `${loc.code.toUpperCase()} Step`,
|
|
11682
|
-
style: { ...inputStyle, padding: "4px 6px", fontSize: 11 }
|
|
11683
|
-
},
|
|
11684
|
-
`st-${st.id}-${loc.code}`
|
|
11685
|
-
)),
|
|
11686
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11687
|
-
"button",
|
|
11688
|
-
{
|
|
11689
|
-
type: "button",
|
|
11690
|
-
disabled: steps.length <= 1,
|
|
11691
|
-
onClick: () => setDraft((prev) => ({
|
|
11692
|
-
...prev,
|
|
11693
|
-
steps: (prev.steps || []).filter((_, i) => i !== sIdx)
|
|
11694
|
-
})),
|
|
11695
|
-
style: {
|
|
11696
|
-
border: "none",
|
|
11697
|
-
background: "transparent",
|
|
11698
|
-
color: steps.length <= 1 ? "#cbd5e1" : "#dc2626",
|
|
11699
|
-
cursor: "pointer",
|
|
11700
|
-
fontSize: 13
|
|
11701
|
-
},
|
|
11702
|
-
children: "×"
|
|
13107
|
+
onClick: () => {
|
|
13108
|
+
setDraft((prev) => {
|
|
13109
|
+
const nextRaw = {
|
|
13110
|
+
...prev,
|
|
13111
|
+
displayMode: m.id
|
|
13112
|
+
};
|
|
13113
|
+
if (m.id === "multi_step") {
|
|
13114
|
+
const norm = normalizeMultiStepDraft(nextRaw);
|
|
13115
|
+
if (norm.steps?.[0]?.id) {
|
|
13116
|
+
setActiveStepId(norm.steps[0].id);
|
|
13117
|
+
}
|
|
13118
|
+
return norm;
|
|
11703
13119
|
}
|
|
11704
|
-
|
|
11705
|
-
|
|
13120
|
+
return nextRaw;
|
|
13121
|
+
});
|
|
13122
|
+
},
|
|
13123
|
+
style: {
|
|
13124
|
+
padding: "7px 8px",
|
|
13125
|
+
borderRadius: 6,
|
|
13126
|
+
border: active ? "1.5px solid #2563eb" : "1px solid #cbd5e1",
|
|
13127
|
+
background: active ? "#eff6ff" : "#f8fafc",
|
|
13128
|
+
color: active ? "#1d4ed8" : "#334155",
|
|
13129
|
+
fontSize: 11,
|
|
13130
|
+
fontWeight: 700,
|
|
13131
|
+
cursor: "pointer"
|
|
13132
|
+
},
|
|
13133
|
+
children: tr ? m.tr : m.en
|
|
11706
13134
|
},
|
|
11707
|
-
|
|
13135
|
+
m.id
|
|
11708
13136
|
);
|
|
11709
13137
|
}) })
|
|
11710
13138
|
]
|
|
@@ -11720,7 +13148,43 @@ const SurveyStudioModal = ({
|
|
|
11720
13148
|
border: "1px solid #cbd5e1"
|
|
11721
13149
|
},
|
|
11722
13150
|
children: [
|
|
11723
|
-
/* @__PURE__ */ jsxRuntime.
|
|
13151
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13152
|
+
"div",
|
|
13153
|
+
{
|
|
13154
|
+
style: {
|
|
13155
|
+
display: "flex",
|
|
13156
|
+
alignItems: "center",
|
|
13157
|
+
justifyContent: "space-between",
|
|
13158
|
+
gap: 6,
|
|
13159
|
+
marginBottom: 6
|
|
13160
|
+
},
|
|
13161
|
+
children: [
|
|
13162
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11, fontWeight: 700, color: "#334155" }, children: tr ? "Soru Tipleri Paleti (Tıklayın veya Kategoriye Sürükleyin):" : "Question Types Palette (Click or Drag into a Step):" }),
|
|
13163
|
+
draft.displayMode === "multi_step" && steps.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13164
|
+
"span",
|
|
13165
|
+
{
|
|
13166
|
+
style: {
|
|
13167
|
+
fontSize: 10,
|
|
13168
|
+
fontWeight: 700,
|
|
13169
|
+
padding: "2px 7px",
|
|
13170
|
+
borderRadius: 10,
|
|
13171
|
+
background: "#eff6ff",
|
|
13172
|
+
color: "#1d4ed8"
|
|
13173
|
+
},
|
|
13174
|
+
children: [
|
|
13175
|
+
tr ? "Hedef:" : "Target:",
|
|
13176
|
+
" ",
|
|
13177
|
+
pickTextForLocale(
|
|
13178
|
+
steps.find((s) => s.id === activeStepId)?.title || steps[0].title,
|
|
13179
|
+
uiLocale,
|
|
13180
|
+
activeStepId
|
|
13181
|
+
)
|
|
13182
|
+
]
|
|
13183
|
+
}
|
|
13184
|
+
)
|
|
13185
|
+
]
|
|
13186
|
+
}
|
|
13187
|
+
),
|
|
11724
13188
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 5 }, children: QUESTION_TYPES_CATALOG.map((qt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11725
13189
|
"button",
|
|
11726
13190
|
{
|
|
@@ -11728,8 +13192,14 @@ const SurveyStudioModal = ({
|
|
|
11728
13192
|
draggable: true,
|
|
11729
13193
|
onDragStart: (e) => {
|
|
11730
13194
|
dragRef.current = { kind: "new-type", qType: qt.type };
|
|
13195
|
+
e.dataTransfer.effectAllowed = "copyMove";
|
|
11731
13196
|
e.dataTransfer.setData("text/plain", qt.type);
|
|
11732
13197
|
},
|
|
13198
|
+
onDragEnd: () => {
|
|
13199
|
+
dragRef.current = null;
|
|
13200
|
+
setDropIndicator(null);
|
|
13201
|
+
clearHoverExpandTimer();
|
|
13202
|
+
},
|
|
11733
13203
|
onClick: () => addQuestionOfType(qt.type),
|
|
11734
13204
|
style: {
|
|
11735
13205
|
padding: "4px 8px",
|
|
@@ -11751,177 +13221,1254 @@ const SurveyStudioModal = ({
|
|
|
11751
13221
|
]
|
|
11752
13222
|
}
|
|
11753
13223
|
),
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
11767
|
-
|
|
13224
|
+
draft.displayMode === "multi_step" ? (() => {
|
|
13225
|
+
const groupedMap = groupQuestionsByStep(questions, steps);
|
|
13226
|
+
const allCollapsed = steps.length > 0 && steps.every((s) => Boolean(collapsedStepIds[s.id]));
|
|
13227
|
+
const addNewStepCategory = () => {
|
|
13228
|
+
const nextIdx = steps.length + 1;
|
|
13229
|
+
const newStepId = `step_${uid("s")}`;
|
|
13230
|
+
const dynamicStepTitles = {};
|
|
13231
|
+
for (const loc of strapiLocales) {
|
|
13232
|
+
dynamicStepTitles[loc.code] = loc.code.toLowerCase().startsWith("tr") ? `${nextIdx}. Adım` : `Step ${nextIdx}`;
|
|
13233
|
+
}
|
|
13234
|
+
if (!dynamicStepTitles.tr) dynamicStepTitles.tr = `${nextIdx}. Adım`;
|
|
13235
|
+
if (!dynamicStepTitles.en) dynamicStepTitles.en = `Step ${nextIdx}`;
|
|
13236
|
+
setDraft(
|
|
13237
|
+
(prev) => normalizeMultiStepDraft({
|
|
13238
|
+
...prev,
|
|
13239
|
+
steps: [
|
|
13240
|
+
...prev.steps || [],
|
|
13241
|
+
{
|
|
13242
|
+
id: newStepId,
|
|
13243
|
+
title: dynamicStepTitles
|
|
13244
|
+
}
|
|
13245
|
+
]
|
|
13246
|
+
})
|
|
13247
|
+
);
|
|
13248
|
+
setActiveStepId(newStepId);
|
|
13249
|
+
setCollapsedStepIds((prev) => ({ ...prev, [newStepId]: false }));
|
|
13250
|
+
};
|
|
13251
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 9 }, children: [
|
|
13252
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13253
|
+
"div",
|
|
13254
|
+
{
|
|
13255
|
+
style: {
|
|
13256
|
+
display: "flex",
|
|
13257
|
+
alignItems: "center",
|
|
13258
|
+
justifyContent: "space-between",
|
|
13259
|
+
flexWrap: "wrap",
|
|
13260
|
+
gap: 6,
|
|
13261
|
+
padding: "6px 10px",
|
|
13262
|
+
borderRadius: 8,
|
|
13263
|
+
background: "#eef2ff",
|
|
13264
|
+
border: "1px solid #c7d2fe"
|
|
13265
|
+
},
|
|
13266
|
+
children: [
|
|
13267
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
13268
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "layers", size: 15, color: "#3730a3" }),
|
|
13269
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 11.5, fontWeight: 800, color: "#1e1b4b" }, children: tr ? `Sihirbaz Kategorileri (${steps.length} Adım • ${questions.length} Soru)` : `Wizard Step Categories (${steps.length} Steps • ${questions.length} Qs)` })
|
|
13270
|
+
] }),
|
|
13271
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 5 }, children: [
|
|
13272
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13273
|
+
"button",
|
|
13274
|
+
{
|
|
13275
|
+
type: "button",
|
|
13276
|
+
onClick: () => {
|
|
13277
|
+
const nextState = {};
|
|
13278
|
+
for (const s of steps) {
|
|
13279
|
+
nextState[s.id] = !allCollapsed;
|
|
13280
|
+
}
|
|
13281
|
+
setCollapsedStepIds(nextState);
|
|
13282
|
+
},
|
|
13283
|
+
style: {
|
|
13284
|
+
padding: "4px 8px",
|
|
13285
|
+
fontSize: 10.5,
|
|
13286
|
+
fontWeight: 700,
|
|
13287
|
+
borderRadius: 5,
|
|
13288
|
+
border: "1px solid #cbd5e1",
|
|
13289
|
+
background: "#ffffff",
|
|
13290
|
+
color: "#334155",
|
|
13291
|
+
cursor: "pointer"
|
|
13292
|
+
},
|
|
13293
|
+
children: allCollapsed ? tr ? "▾ Tümünü Aç" : "▾ Expand All" : tr ? "▸ Tümünü Daralt" : "▸ Collapse All"
|
|
13294
|
+
}
|
|
13295
|
+
),
|
|
13296
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13297
|
+
"button",
|
|
13298
|
+
{
|
|
13299
|
+
type: "button",
|
|
13300
|
+
onClick: addNewStepCategory,
|
|
13301
|
+
style: {
|
|
13302
|
+
padding: "4px 10px",
|
|
13303
|
+
fontSize: 10.5,
|
|
13304
|
+
fontWeight: 700,
|
|
13305
|
+
borderRadius: 5,
|
|
13306
|
+
border: "none",
|
|
13307
|
+
background: "#2563eb",
|
|
13308
|
+
color: "#ffffff",
|
|
13309
|
+
cursor: "pointer"
|
|
13310
|
+
},
|
|
13311
|
+
children: tr ? "+ Yeni Adım Ekle" : "+ Add Step"
|
|
13312
|
+
}
|
|
13313
|
+
)
|
|
13314
|
+
] })
|
|
13315
|
+
]
|
|
11768
13316
|
}
|
|
11769
|
-
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
const
|
|
11773
|
-
const
|
|
11774
|
-
const
|
|
13317
|
+
),
|
|
13318
|
+
steps.map((st, sIdx) => {
|
|
13319
|
+
const stTitleObj = normalizeLocalizedRecord(st.title, strapiLocales);
|
|
13320
|
+
const stepEntries = groupedMap.get(st.id) || [];
|
|
13321
|
+
const isCollapsed = Boolean(collapsedStepIds[st.id]);
|
|
13322
|
+
const isFocusedStep = activeStepId === st.id;
|
|
13323
|
+
const containsSelectedQ = stepEntries.some(
|
|
13324
|
+
(ent) => ent.globalIndex === selectedQuestionIdx
|
|
13325
|
+
);
|
|
13326
|
+
const stepIndicatorBefore = dropIndicator?.kind === "step" && dropIndicator.targetId === st.id && dropIndicator.position === "before";
|
|
13327
|
+
const stepIndicatorAfter = dropIndicator?.kind === "step" && dropIndicator.targetId === st.id && dropIndicator.position === "after";
|
|
13328
|
+
const isQuestionZoneHovered = dropIndicator?.kind === "step-zone" && dropIndicator.targetId === st.id;
|
|
13329
|
+
const handleDropIntoStepEnd = (item) => {
|
|
13330
|
+
const prevSelectedKey = activeQ?.key;
|
|
13331
|
+
if (item.kind === "question") {
|
|
13332
|
+
const nextDraft = moveQuestionInMultiStepDraft(
|
|
13333
|
+
draft,
|
|
13334
|
+
item.questionKey,
|
|
13335
|
+
{
|
|
13336
|
+
stepId: st.id,
|
|
13337
|
+
position: "end"
|
|
13338
|
+
}
|
|
13339
|
+
);
|
|
13340
|
+
setDraft(nextDraft);
|
|
13341
|
+
selectQuestionByKey(nextDraft.questions, item.questionKey || prevSelectedKey);
|
|
13342
|
+
setActiveStepId(st.id);
|
|
13343
|
+
setCollapsedStepIds((prev) => ({ ...prev, [st.id]: false }));
|
|
13344
|
+
} else if (item.kind === "new-type") {
|
|
13345
|
+
const newQ = buildQuestionFromType(
|
|
13346
|
+
item.qType,
|
|
13347
|
+
st.id,
|
|
13348
|
+
questions.map((q) => q.key)
|
|
13349
|
+
);
|
|
13350
|
+
const { draft: nextDraft, insertedIndex } = insertQuestionInMultiStepDraft(draft, newQ, {
|
|
13351
|
+
stepId: st.id,
|
|
13352
|
+
position: "end"
|
|
13353
|
+
});
|
|
13354
|
+
setDraft(nextDraft);
|
|
13355
|
+
setSelectedQuestionIdx(insertedIndex);
|
|
13356
|
+
setActiveStepId(st.id);
|
|
13357
|
+
setCollapsedStepIds((prev) => ({ ...prev, [st.id]: false }));
|
|
13358
|
+
}
|
|
13359
|
+
};
|
|
11775
13360
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11776
13361
|
"div",
|
|
11777
13362
|
{
|
|
11778
|
-
draggable: true,
|
|
11779
|
-
onDragStart: (e) => {
|
|
11780
|
-
dragRef.current = { kind: "question", index: qIdx };
|
|
11781
|
-
e.dataTransfer.setData("text/plain", q.key);
|
|
11782
|
-
},
|
|
11783
|
-
onDragOver: (e) => {
|
|
11784
|
-
if (dragRef.current?.kind === "question" || dragRef.current?.kind === "new-type") {
|
|
11785
|
-
e.preventDefault();
|
|
11786
|
-
e.stopPropagation();
|
|
11787
|
-
}
|
|
11788
|
-
},
|
|
11789
|
-
onDrop: (e) => {
|
|
11790
|
-
e.preventDefault();
|
|
11791
|
-
e.stopPropagation();
|
|
11792
|
-
const item = dragRef.current;
|
|
11793
|
-
dragRef.current = null;
|
|
11794
|
-
if (!item) return;
|
|
11795
|
-
if (item.kind === "new-type") {
|
|
11796
|
-
addQuestionOfType(item.qType, qIdx);
|
|
11797
|
-
return;
|
|
11798
|
-
}
|
|
11799
|
-
if (item.kind === "question" && item.index !== qIdx) {
|
|
11800
|
-
const next = [...questions];
|
|
11801
|
-
const [moved] = next.splice(item.index, 1);
|
|
11802
|
-
next.splice(qIdx, 0, moved);
|
|
11803
|
-
setDraft((prev) => ({ ...prev, questions: next }));
|
|
11804
|
-
setSelectedQuestionIdx(qIdx);
|
|
11805
|
-
}
|
|
11806
|
-
},
|
|
11807
|
-
onClick: () => setSelectedQuestionIdx(qIdx),
|
|
11808
13363
|
style: {
|
|
11809
|
-
|
|
11810
|
-
borderRadius:
|
|
11811
|
-
border:
|
|
11812
|
-
background:
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
alignItems: "center",
|
|
11816
|
-
justifyContent: "space-between",
|
|
11817
|
-
gap: 8
|
|
13364
|
+
position: "relative",
|
|
13365
|
+
borderRadius: 10,
|
|
13366
|
+
border: isQuestionZoneHovered ? "2px dashed #2563eb" : isFocusedStep || containsSelectedQ ? "1.5px solid #60a5fa" : "1px solid #cbd5e1",
|
|
13367
|
+
background: "#ffffff",
|
|
13368
|
+
boxShadow: isFocusedStep || containsSelectedQ ? "0 2px 10px rgba(37, 99, 235, 0.08)" : "none",
|
|
13369
|
+
transition: "border-color 0.14s ease, box-shadow 0.14s ease"
|
|
11818
13370
|
},
|
|
11819
13371
|
children: [
|
|
13372
|
+
stepIndicatorBefore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13373
|
+
"div",
|
|
13374
|
+
{
|
|
13375
|
+
style: {
|
|
13376
|
+
position: "absolute",
|
|
13377
|
+
top: -5,
|
|
13378
|
+
left: 6,
|
|
13379
|
+
right: 6,
|
|
13380
|
+
height: 3,
|
|
13381
|
+
borderRadius: 3,
|
|
13382
|
+
background: "#2563eb",
|
|
13383
|
+
zIndex: 5
|
|
13384
|
+
}
|
|
13385
|
+
}
|
|
13386
|
+
),
|
|
11820
13387
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11821
13388
|
"div",
|
|
11822
13389
|
{
|
|
13390
|
+
draggable: stepDragReadyId === st.id,
|
|
13391
|
+
onClick: () => setActiveStepId(st.id),
|
|
13392
|
+
onDragStart: (e) => {
|
|
13393
|
+
if (stepDragReadyId !== st.id) {
|
|
13394
|
+
e.preventDefault();
|
|
13395
|
+
return;
|
|
13396
|
+
}
|
|
13397
|
+
dragRef.current = {
|
|
13398
|
+
kind: "step",
|
|
13399
|
+
index: sIdx,
|
|
13400
|
+
stepId: st.id
|
|
13401
|
+
};
|
|
13402
|
+
e.dataTransfer.effectAllowed = "move";
|
|
13403
|
+
e.dataTransfer.setData("text/plain", st.id);
|
|
13404
|
+
},
|
|
13405
|
+
onDragEnd: () => {
|
|
13406
|
+
dragRef.current = null;
|
|
13407
|
+
setStepDragReadyId(null);
|
|
13408
|
+
setDropIndicator(null);
|
|
13409
|
+
clearHoverExpandTimer();
|
|
13410
|
+
},
|
|
13411
|
+
onDragOver: (e) => {
|
|
13412
|
+
const item = dragRef.current;
|
|
13413
|
+
if (!item) return;
|
|
13414
|
+
if (item.kind === "step") {
|
|
13415
|
+
if (item.stepId === st.id) return;
|
|
13416
|
+
e.preventDefault();
|
|
13417
|
+
e.stopPropagation();
|
|
13418
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
13419
|
+
const pos = e.clientY - rect.top < rect.height / 2 ? "before" : "after";
|
|
13420
|
+
setDropIndicator({ kind: "step", targetId: st.id, position: pos });
|
|
13421
|
+
} else if (item.kind === "question" || item.kind === "new-type") {
|
|
13422
|
+
e.preventDefault();
|
|
13423
|
+
e.stopPropagation();
|
|
13424
|
+
setDropIndicator({ kind: "step-zone", targetId: st.id });
|
|
13425
|
+
if (isCollapsed && hoverExpandTimerRef.current?.stepId !== st.id) {
|
|
13426
|
+
clearHoverExpandTimer();
|
|
13427
|
+
hoverExpandTimerRef.current = {
|
|
13428
|
+
stepId: st.id,
|
|
13429
|
+
timer: setTimeout(() => {
|
|
13430
|
+
setCollapsedStepIds((prev) => ({
|
|
13431
|
+
...prev,
|
|
13432
|
+
[st.id]: false
|
|
13433
|
+
}));
|
|
13434
|
+
hoverExpandTimerRef.current = null;
|
|
13435
|
+
}, 380)
|
|
13436
|
+
};
|
|
13437
|
+
}
|
|
13438
|
+
}
|
|
13439
|
+
},
|
|
13440
|
+
onDragLeave: () => {
|
|
13441
|
+
clearHoverExpandTimer();
|
|
13442
|
+
},
|
|
13443
|
+
onDrop: (e) => {
|
|
13444
|
+
e.preventDefault();
|
|
13445
|
+
e.stopPropagation();
|
|
13446
|
+
clearHoverExpandTimer();
|
|
13447
|
+
const item = dragRef.current;
|
|
13448
|
+
const curInd = dropIndicator;
|
|
13449
|
+
dragRef.current = null;
|
|
13450
|
+
setStepDragReadyId(null);
|
|
13451
|
+
setDropIndicator(null);
|
|
13452
|
+
if (!item) return;
|
|
13453
|
+
if (item.kind === "step" && item.stepId !== st.id) {
|
|
13454
|
+
const prevSelectedKey = activeQ?.key;
|
|
13455
|
+
const pos = curInd?.kind === "step" && curInd.targetId === st.id ? curInd.position : "before";
|
|
13456
|
+
const nextDraft = reorderStepsInDraft(
|
|
13457
|
+
draft,
|
|
13458
|
+
item.stepId,
|
|
13459
|
+
st.id,
|
|
13460
|
+
pos
|
|
13461
|
+
);
|
|
13462
|
+
setDraft(nextDraft);
|
|
13463
|
+
selectQuestionByKey(nextDraft.questions, prevSelectedKey);
|
|
13464
|
+
return;
|
|
13465
|
+
}
|
|
13466
|
+
if (item.kind === "question" || item.kind === "new-type") {
|
|
13467
|
+
handleDropIntoStepEnd(item);
|
|
13468
|
+
}
|
|
13469
|
+
},
|
|
13470
|
+
style: {
|
|
13471
|
+
padding: "8px 10px",
|
|
13472
|
+
borderTopLeftRadius: 9,
|
|
13473
|
+
borderTopRightRadius: 9,
|
|
13474
|
+
borderBottomLeftRadius: isCollapsed ? 9 : 0,
|
|
13475
|
+
borderBottomRightRadius: isCollapsed ? 9 : 0,
|
|
13476
|
+
borderBottom: isCollapsed ? "none" : "1px solid #e2e8f0",
|
|
13477
|
+
background: isQuestionZoneHovered ? "#dbeafe" : isFocusedStep || containsSelectedQ ? "#eff6ff" : "#f8fafc",
|
|
13478
|
+
display: "flex",
|
|
13479
|
+
flexDirection: "column",
|
|
13480
|
+
gap: 6
|
|
13481
|
+
},
|
|
13482
|
+
children: [
|
|
13483
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13484
|
+
"div",
|
|
13485
|
+
{
|
|
13486
|
+
style: {
|
|
13487
|
+
display: "flex",
|
|
13488
|
+
alignItems: "center",
|
|
13489
|
+
justifyContent: "space-between",
|
|
13490
|
+
gap: 6
|
|
13491
|
+
},
|
|
13492
|
+
children: [
|
|
13493
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13494
|
+
"div",
|
|
13495
|
+
{
|
|
13496
|
+
style: {
|
|
13497
|
+
display: "flex",
|
|
13498
|
+
alignItems: "center",
|
|
13499
|
+
gap: 6,
|
|
13500
|
+
minWidth: 0
|
|
13501
|
+
},
|
|
13502
|
+
children: [
|
|
13503
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13504
|
+
"span",
|
|
13505
|
+
{
|
|
13506
|
+
onMouseDown: () => setStepDragReadyId(st.id),
|
|
13507
|
+
onMouseUp: () => setStepDragReadyId(null),
|
|
13508
|
+
title: tr ? "Adımı sürükleyerek sıralayın" : "Drag to reorder step category",
|
|
13509
|
+
style: {
|
|
13510
|
+
display: "inline-flex",
|
|
13511
|
+
alignItems: "center",
|
|
13512
|
+
padding: "2px 3px",
|
|
13513
|
+
borderRadius: 4,
|
|
13514
|
+
cursor: "grab",
|
|
13515
|
+
background: "#e2e8f0"
|
|
13516
|
+
},
|
|
13517
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13518
|
+
index.MaterialIcon,
|
|
13519
|
+
{
|
|
13520
|
+
name: "drag_indicator",
|
|
13521
|
+
size: 15,
|
|
13522
|
+
color: "#334155"
|
|
13523
|
+
}
|
|
13524
|
+
)
|
|
13525
|
+
}
|
|
13526
|
+
),
|
|
13527
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13528
|
+
"button",
|
|
13529
|
+
{
|
|
13530
|
+
type: "button",
|
|
13531
|
+
onClick: (e) => {
|
|
13532
|
+
e.stopPropagation();
|
|
13533
|
+
setCollapsedStepIds((prev) => ({
|
|
13534
|
+
...prev,
|
|
13535
|
+
[st.id]: !prev[st.id]
|
|
13536
|
+
}));
|
|
13537
|
+
setActiveStepId(st.id);
|
|
13538
|
+
},
|
|
13539
|
+
style: {
|
|
13540
|
+
border: "none",
|
|
13541
|
+
background: "transparent",
|
|
13542
|
+
padding: "2px 4px",
|
|
13543
|
+
cursor: "pointer",
|
|
13544
|
+
fontSize: 12,
|
|
13545
|
+
fontWeight: 800,
|
|
13546
|
+
color: "#1e3a8a",
|
|
13547
|
+
display: "inline-flex",
|
|
13548
|
+
alignItems: "center",
|
|
13549
|
+
gap: 5
|
|
13550
|
+
},
|
|
13551
|
+
children: [
|
|
13552
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: isCollapsed ? "▸" : "▾" }),
|
|
13553
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13554
|
+
"span",
|
|
13555
|
+
{
|
|
13556
|
+
style: {
|
|
13557
|
+
padding: "2px 7px",
|
|
13558
|
+
borderRadius: 6,
|
|
13559
|
+
background: "#1e3a8a",
|
|
13560
|
+
color: "#ffffff",
|
|
13561
|
+
fontSize: 10.5,
|
|
13562
|
+
fontWeight: 800
|
|
13563
|
+
},
|
|
13564
|
+
children: tr ? `Adım ${sIdx + 1}` : `Step ${sIdx + 1}`
|
|
13565
|
+
}
|
|
13566
|
+
),
|
|
13567
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13568
|
+
"span",
|
|
13569
|
+
{
|
|
13570
|
+
style: {
|
|
13571
|
+
fontSize: 12,
|
|
13572
|
+
fontWeight: 700,
|
|
13573
|
+
color: "#0f172a"
|
|
13574
|
+
},
|
|
13575
|
+
children: pickTextForLocale(st.title, uiLocale, st.id)
|
|
13576
|
+
}
|
|
13577
|
+
)
|
|
13578
|
+
]
|
|
13579
|
+
}
|
|
13580
|
+
)
|
|
13581
|
+
]
|
|
13582
|
+
}
|
|
13583
|
+
),
|
|
13584
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
13585
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13586
|
+
"span",
|
|
13587
|
+
{
|
|
13588
|
+
style: {
|
|
13589
|
+
fontSize: 10.5,
|
|
13590
|
+
fontWeight: 700,
|
|
13591
|
+
padding: "2px 8px",
|
|
13592
|
+
borderRadius: 10,
|
|
13593
|
+
background: stepEntries.length > 0 ? "#dbeafe" : "#f1f5f9",
|
|
13594
|
+
color: stepEntries.length > 0 ? "#1e40af" : "#64748b"
|
|
13595
|
+
},
|
|
13596
|
+
children: [
|
|
13597
|
+
stepEntries.length,
|
|
13598
|
+
" ",
|
|
13599
|
+
tr ? "soru" : "Qs"
|
|
13600
|
+
]
|
|
13601
|
+
}
|
|
13602
|
+
),
|
|
13603
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13604
|
+
"button",
|
|
13605
|
+
{
|
|
13606
|
+
type: "button",
|
|
13607
|
+
disabled: sIdx === 0,
|
|
13608
|
+
onClick: (e) => {
|
|
13609
|
+
e.stopPropagation();
|
|
13610
|
+
const prevKey = activeQ?.key;
|
|
13611
|
+
const nextDraft = shiftStepByOffset(draft, st.id, -1);
|
|
13612
|
+
setDraft(nextDraft);
|
|
13613
|
+
selectQuestionByKey(nextDraft.questions, prevKey);
|
|
13614
|
+
},
|
|
13615
|
+
title: tr ? "Kategoriyi yukarı taşı" : "Move step up",
|
|
13616
|
+
style: {
|
|
13617
|
+
border: "1px solid #cbd5e1",
|
|
13618
|
+
background: "#ffffff",
|
|
13619
|
+
color: sIdx === 0 ? "#cbd5e1" : "#334155",
|
|
13620
|
+
borderRadius: 4,
|
|
13621
|
+
padding: "1px 5px",
|
|
13622
|
+
fontSize: 11,
|
|
13623
|
+
cursor: sIdx === 0 ? "default" : "pointer"
|
|
13624
|
+
},
|
|
13625
|
+
children: "↑"
|
|
13626
|
+
}
|
|
13627
|
+
),
|
|
13628
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13629
|
+
"button",
|
|
13630
|
+
{
|
|
13631
|
+
type: "button",
|
|
13632
|
+
disabled: sIdx === steps.length - 1,
|
|
13633
|
+
onClick: (e) => {
|
|
13634
|
+
e.stopPropagation();
|
|
13635
|
+
const prevKey = activeQ?.key;
|
|
13636
|
+
const nextDraft = shiftStepByOffset(draft, st.id, 1);
|
|
13637
|
+
setDraft(nextDraft);
|
|
13638
|
+
selectQuestionByKey(nextDraft.questions, prevKey);
|
|
13639
|
+
},
|
|
13640
|
+
title: tr ? "Kategoriyi aşağı taşı" : "Move step down",
|
|
13641
|
+
style: {
|
|
13642
|
+
border: "1px solid #cbd5e1",
|
|
13643
|
+
background: "#ffffff",
|
|
13644
|
+
color: sIdx === steps.length - 1 ? "#cbd5e1" : "#334155",
|
|
13645
|
+
borderRadius: 4,
|
|
13646
|
+
padding: "1px 5px",
|
|
13647
|
+
fontSize: 11,
|
|
13648
|
+
cursor: sIdx === steps.length - 1 ? "default" : "pointer"
|
|
13649
|
+
},
|
|
13650
|
+
children: "↓"
|
|
13651
|
+
}
|
|
13652
|
+
),
|
|
13653
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13654
|
+
"button",
|
|
13655
|
+
{
|
|
13656
|
+
type: "button",
|
|
13657
|
+
disabled: steps.length <= 1,
|
|
13658
|
+
onClick: (e) => {
|
|
13659
|
+
e.stopPropagation();
|
|
13660
|
+
const prevKey = activeQ?.key;
|
|
13661
|
+
const res = deleteStepWithQuestionReassignment(
|
|
13662
|
+
draft,
|
|
13663
|
+
st.id
|
|
13664
|
+
);
|
|
13665
|
+
setDraft(res.draft);
|
|
13666
|
+
setActiveStepId(res.fallbackStepId);
|
|
13667
|
+
setCollapsedStepIds((prev) => ({
|
|
13668
|
+
...prev,
|
|
13669
|
+
[res.fallbackStepId]: false
|
|
13670
|
+
}));
|
|
13671
|
+
selectQuestionByKey(res.draft.questions, prevKey);
|
|
13672
|
+
if (res.movedQuestionCount > 0) {
|
|
13673
|
+
setStatusMsg(
|
|
13674
|
+
tr ? `${res.movedQuestionCount} soru komşu adıma aktarıldı.` : `${res.movedQuestionCount} question(s) moved to adjacent step.`
|
|
13675
|
+
);
|
|
13676
|
+
}
|
|
13677
|
+
},
|
|
13678
|
+
title: tr ? "Adımı sil (içindeki sorular komşu adıma aktarılır)" : "Delete step (reassigns questions safely)",
|
|
13679
|
+
style: {
|
|
13680
|
+
border: "none",
|
|
13681
|
+
background: "transparent",
|
|
13682
|
+
color: steps.length <= 1 ? "#cbd5e1" : "#dc2626",
|
|
13683
|
+
cursor: steps.length <= 1 ? "default" : "pointer",
|
|
13684
|
+
fontSize: 14,
|
|
13685
|
+
fontWeight: 700,
|
|
13686
|
+
padding: "0 4px"
|
|
13687
|
+
},
|
|
13688
|
+
children: "×"
|
|
13689
|
+
}
|
|
13690
|
+
)
|
|
13691
|
+
] })
|
|
13692
|
+
]
|
|
13693
|
+
}
|
|
13694
|
+
),
|
|
13695
|
+
!isCollapsed && (() => {
|
|
13696
|
+
const stDescObj = normalizeLocalizedRecord(
|
|
13697
|
+
st.description,
|
|
13698
|
+
strapiLocales
|
|
13699
|
+
);
|
|
13700
|
+
const hasFilledDesc = Object.values(stDescObj).some(
|
|
13701
|
+
(val) => String(val || "").trim().length > 0
|
|
13702
|
+
);
|
|
13703
|
+
const showStepDesc = openStepDescIds[st.id] !== void 0 ? openStepDescIds[st.id] : hasFilledDesc;
|
|
13704
|
+
const stepLocaleCols = `repeat(${Math.min(
|
|
13705
|
+
Math.max(strapiLocales.length, 1),
|
|
13706
|
+
2
|
|
13707
|
+
)}, minmax(0, 1fr))`;
|
|
13708
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13709
|
+
"div",
|
|
13710
|
+
{
|
|
13711
|
+
onMouseDown: (e) => {
|
|
13712
|
+
e.stopPropagation();
|
|
13713
|
+
setStepDragReadyId(null);
|
|
13714
|
+
},
|
|
13715
|
+
onClick: (e) => e.stopPropagation(),
|
|
13716
|
+
style: {
|
|
13717
|
+
display: "flex",
|
|
13718
|
+
flexDirection: "column",
|
|
13719
|
+
gap: 6
|
|
13720
|
+
},
|
|
13721
|
+
children: [
|
|
13722
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13723
|
+
"div",
|
|
13724
|
+
{
|
|
13725
|
+
style: {
|
|
13726
|
+
display: "grid",
|
|
13727
|
+
gridTemplateColumns: stepLocaleCols,
|
|
13728
|
+
gap: 5
|
|
13729
|
+
},
|
|
13730
|
+
children: strapiLocales.map((loc) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13731
|
+
"div",
|
|
13732
|
+
{
|
|
13733
|
+
style: {
|
|
13734
|
+
display: "flex",
|
|
13735
|
+
alignItems: "stretch",
|
|
13736
|
+
borderRadius: 6,
|
|
13737
|
+
border: "1px solid #cbd5e1",
|
|
13738
|
+
background: "#ffffff",
|
|
13739
|
+
overflow: "hidden"
|
|
13740
|
+
},
|
|
13741
|
+
children: [
|
|
13742
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13743
|
+
"span",
|
|
13744
|
+
{
|
|
13745
|
+
title: loc.name || loc.code,
|
|
13746
|
+
style: {
|
|
13747
|
+
padding: "0 7px",
|
|
13748
|
+
background: loc.isDefault ? "#dbeafe" : "#f1f5f9",
|
|
13749
|
+
color: loc.isDefault ? "#1e40af" : "#334155",
|
|
13750
|
+
fontSize: 10,
|
|
13751
|
+
fontWeight: 800,
|
|
13752
|
+
borderRight: "1px solid #cbd5e1",
|
|
13753
|
+
display: "inline-flex",
|
|
13754
|
+
alignItems: "center",
|
|
13755
|
+
flexShrink: 0
|
|
13756
|
+
},
|
|
13757
|
+
children: loc.code.toUpperCase()
|
|
13758
|
+
}
|
|
13759
|
+
),
|
|
13760
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13761
|
+
"input",
|
|
13762
|
+
{
|
|
13763
|
+
type: "text",
|
|
13764
|
+
value: stTitleObj[loc.code] || "",
|
|
13765
|
+
onChange: (e) => {
|
|
13766
|
+
const nextSteps = steps.map(
|
|
13767
|
+
(item, i) => i === sIdx ? {
|
|
13768
|
+
...item,
|
|
13769
|
+
title: {
|
|
13770
|
+
...stTitleObj,
|
|
13771
|
+
[loc.code]: e.target.value
|
|
13772
|
+
}
|
|
13773
|
+
} : item
|
|
13774
|
+
);
|
|
13775
|
+
setDraft((prev) => ({
|
|
13776
|
+
...prev,
|
|
13777
|
+
steps: nextSteps
|
|
13778
|
+
}));
|
|
13779
|
+
},
|
|
13780
|
+
placeholder: tr ? "Kategori Başlığı" : "Step Title",
|
|
13781
|
+
style: {
|
|
13782
|
+
flex: 1,
|
|
13783
|
+
minWidth: 0,
|
|
13784
|
+
border: "none",
|
|
13785
|
+
outline: "none",
|
|
13786
|
+
padding: "4px 7px",
|
|
13787
|
+
fontSize: 11,
|
|
13788
|
+
color: "#0f172a",
|
|
13789
|
+
background: "transparent"
|
|
13790
|
+
}
|
|
13791
|
+
}
|
|
13792
|
+
)
|
|
13793
|
+
]
|
|
13794
|
+
},
|
|
13795
|
+
`st-${st.id}-${loc.code}`
|
|
13796
|
+
))
|
|
13797
|
+
}
|
|
13798
|
+
),
|
|
13799
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13800
|
+
"button",
|
|
13801
|
+
{
|
|
13802
|
+
type: "button",
|
|
13803
|
+
onClick: () => setOpenStepDescIds((prev) => ({
|
|
13804
|
+
...prev,
|
|
13805
|
+
[st.id]: !showStepDesc
|
|
13806
|
+
})),
|
|
13807
|
+
style: {
|
|
13808
|
+
border: "none",
|
|
13809
|
+
background: "transparent",
|
|
13810
|
+
padding: "1px 2px",
|
|
13811
|
+
fontSize: 10.5,
|
|
13812
|
+
fontWeight: 700,
|
|
13813
|
+
color: showStepDesc ? "#1d4ed8" : "#64748b",
|
|
13814
|
+
cursor: "pointer",
|
|
13815
|
+
display: "inline-flex",
|
|
13816
|
+
alignItems: "center",
|
|
13817
|
+
gap: 4
|
|
13818
|
+
},
|
|
13819
|
+
children: [
|
|
13820
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: showStepDesc ? "▾" : "+" }),
|
|
13821
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? "Kategori Alt Açıklaması (Opsiyonel)" : "Step Subtitle / Description (Optional)" })
|
|
13822
|
+
]
|
|
13823
|
+
}
|
|
13824
|
+
) }),
|
|
13825
|
+
showStepDesc && /* @__PURE__ */ jsxRuntime.jsx(
|
|
13826
|
+
"div",
|
|
13827
|
+
{
|
|
13828
|
+
style: {
|
|
13829
|
+
display: "grid",
|
|
13830
|
+
gridTemplateColumns: stepLocaleCols,
|
|
13831
|
+
gap: 5
|
|
13832
|
+
},
|
|
13833
|
+
children: strapiLocales.map((loc) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13834
|
+
"div",
|
|
13835
|
+
{
|
|
13836
|
+
style: {
|
|
13837
|
+
display: "flex",
|
|
13838
|
+
alignItems: "stretch",
|
|
13839
|
+
borderRadius: 6,
|
|
13840
|
+
border: "1px dashed #cbd5e1",
|
|
13841
|
+
background: "#f8fafc",
|
|
13842
|
+
overflow: "hidden"
|
|
13843
|
+
},
|
|
13844
|
+
children: [
|
|
13845
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13846
|
+
"span",
|
|
13847
|
+
{
|
|
13848
|
+
style: {
|
|
13849
|
+
padding: "0 6px",
|
|
13850
|
+
background: "#e2e8f0",
|
|
13851
|
+
color: "#475569",
|
|
13852
|
+
fontSize: 9.5,
|
|
13853
|
+
fontWeight: 800,
|
|
13854
|
+
borderRight: "1px solid #cbd5e1",
|
|
13855
|
+
display: "inline-flex",
|
|
13856
|
+
alignItems: "center",
|
|
13857
|
+
flexShrink: 0
|
|
13858
|
+
},
|
|
13859
|
+
children: loc.code.toUpperCase()
|
|
13860
|
+
}
|
|
13861
|
+
),
|
|
13862
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13863
|
+
"input",
|
|
13864
|
+
{
|
|
13865
|
+
type: "text",
|
|
13866
|
+
value: stDescObj[loc.code] || "",
|
|
13867
|
+
onChange: (e) => {
|
|
13868
|
+
const nextSteps = steps.map(
|
|
13869
|
+
(item, i) => i === sIdx ? {
|
|
13870
|
+
...item,
|
|
13871
|
+
description: {
|
|
13872
|
+
...stDescObj,
|
|
13873
|
+
[loc.code]: e.target.value
|
|
13874
|
+
}
|
|
13875
|
+
} : item
|
|
13876
|
+
);
|
|
13877
|
+
setDraft((prev) => ({
|
|
13878
|
+
...prev,
|
|
13879
|
+
steps: nextSteps
|
|
13880
|
+
}));
|
|
13881
|
+
},
|
|
13882
|
+
placeholder: tr ? "Opsiyonel alt açıklama..." : "Optional step description...",
|
|
13883
|
+
style: {
|
|
13884
|
+
flex: 1,
|
|
13885
|
+
minWidth: 0,
|
|
13886
|
+
border: "none",
|
|
13887
|
+
outline: "none",
|
|
13888
|
+
padding: "4px 7px",
|
|
13889
|
+
fontSize: 10.5,
|
|
13890
|
+
color: "#334155",
|
|
13891
|
+
background: "transparent"
|
|
13892
|
+
}
|
|
13893
|
+
}
|
|
13894
|
+
)
|
|
13895
|
+
]
|
|
13896
|
+
},
|
|
13897
|
+
`stdesc-${st.id}-${loc.code}`
|
|
13898
|
+
))
|
|
13899
|
+
}
|
|
13900
|
+
)
|
|
13901
|
+
]
|
|
13902
|
+
}
|
|
13903
|
+
);
|
|
13904
|
+
})()
|
|
13905
|
+
]
|
|
13906
|
+
}
|
|
13907
|
+
),
|
|
13908
|
+
!isCollapsed && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13909
|
+
"div",
|
|
13910
|
+
{
|
|
13911
|
+
onDragOver: (e) => {
|
|
13912
|
+
const item = dragRef.current;
|
|
13913
|
+
if (item?.kind === "question" || item?.kind === "new-type") {
|
|
13914
|
+
e.preventDefault();
|
|
13915
|
+
setDropIndicator({ kind: "step-zone", targetId: st.id });
|
|
13916
|
+
}
|
|
13917
|
+
},
|
|
13918
|
+
onDrop: (e) => {
|
|
13919
|
+
const item = dragRef.current;
|
|
13920
|
+
if (item?.kind === "question" || item?.kind === "new-type") {
|
|
13921
|
+
e.preventDefault();
|
|
13922
|
+
e.stopPropagation();
|
|
13923
|
+
dragRef.current = null;
|
|
13924
|
+
setDropIndicator(null);
|
|
13925
|
+
handleDropIntoStepEnd(item);
|
|
13926
|
+
}
|
|
13927
|
+
},
|
|
11823
13928
|
style: {
|
|
13929
|
+
padding: 9,
|
|
11824
13930
|
display: "flex",
|
|
11825
|
-
|
|
11826
|
-
gap:
|
|
11827
|
-
|
|
13931
|
+
flexDirection: "column",
|
|
13932
|
+
gap: 6,
|
|
13933
|
+
background: isQuestionZoneHovered ? "#f0f9ff" : "#ffffff",
|
|
13934
|
+
borderBottomLeftRadius: 9,
|
|
13935
|
+
borderBottomRightRadius: 9
|
|
11828
13936
|
},
|
|
11829
13937
|
children: [
|
|
11830
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11831
|
-
|
|
13938
|
+
stepEntries.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
13939
|
+
"div",
|
|
11832
13940
|
{
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
13941
|
+
style: {
|
|
13942
|
+
padding: "14px 10px",
|
|
13943
|
+
borderRadius: 7,
|
|
13944
|
+
border: "1.5 dashed #cbd5e1",
|
|
13945
|
+
borderStyle: "dashed",
|
|
13946
|
+
background: "#f8fafc",
|
|
13947
|
+
textAlign: "center",
|
|
13948
|
+
fontSize: 11,
|
|
13949
|
+
color: "#64748b"
|
|
13950
|
+
},
|
|
13951
|
+
children: tr ? "Bu adımda henüz soru yok — Yukarıdan soru tipi sürükleyin veya başka bir adımdan soru taşıyın." : "No questions in this step yet — Drag a question here from another step or from the palette above."
|
|
11836
13952
|
}
|
|
11837
|
-
),
|
|
11838
|
-
|
|
11839
|
-
|
|
13953
|
+
) : stepEntries.map(({ question: q, globalIndex: qIdx, localIndex }) => {
|
|
13954
|
+
const selected = qIdx === selectedQuestionIdx;
|
|
13955
|
+
const qTitle = pickTextForLocale(q.title, uiLocale, q.key);
|
|
13956
|
+
const hasCond = q.conditions && Array.isArray(q.conditions.rules) && q.conditions.rules.length > 0;
|
|
13957
|
+
const qIndBefore = dropIndicator?.kind === "question" && dropIndicator.targetId === q.key && dropIndicator.position === "before";
|
|
13958
|
+
const qIndAfter = dropIndicator?.kind === "question" && dropIndicator.targetId === q.key && dropIndicator.position === "after";
|
|
13959
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11840
13960
|
"div",
|
|
11841
13961
|
{
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
13962
|
+
draggable: true,
|
|
13963
|
+
onDragStart: (e) => {
|
|
13964
|
+
e.stopPropagation();
|
|
13965
|
+
dragRef.current = {
|
|
13966
|
+
kind: "question",
|
|
13967
|
+
index: qIdx,
|
|
13968
|
+
questionKey: q.key,
|
|
13969
|
+
fromStepId: st.id
|
|
13970
|
+
};
|
|
13971
|
+
e.dataTransfer.effectAllowed = "move";
|
|
13972
|
+
e.dataTransfer.setData("text/plain", q.key);
|
|
13973
|
+
},
|
|
13974
|
+
onDragEnd: () => {
|
|
13975
|
+
dragRef.current = null;
|
|
13976
|
+
setDropIndicator(null);
|
|
13977
|
+
clearHoverExpandTimer();
|
|
13978
|
+
},
|
|
13979
|
+
onDragOver: (e) => {
|
|
13980
|
+
const item = dragRef.current;
|
|
13981
|
+
if (item?.kind === "question" || item?.kind === "new-type") {
|
|
13982
|
+
e.preventDefault();
|
|
13983
|
+
e.stopPropagation();
|
|
13984
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
13985
|
+
const pos = e.clientY - rect.top < rect.height / 2 ? "before" : "after";
|
|
13986
|
+
setDropIndicator({
|
|
13987
|
+
kind: "question",
|
|
13988
|
+
targetId: q.key,
|
|
13989
|
+
position: pos
|
|
13990
|
+
});
|
|
13991
|
+
}
|
|
13992
|
+
},
|
|
13993
|
+
onDrop: (e) => {
|
|
13994
|
+
e.preventDefault();
|
|
13995
|
+
e.stopPropagation();
|
|
13996
|
+
const item = dragRef.current;
|
|
13997
|
+
const curInd = dropIndicator;
|
|
13998
|
+
dragRef.current = null;
|
|
13999
|
+
setDropIndicator(null);
|
|
14000
|
+
if (!item) return;
|
|
14001
|
+
const pos = curInd?.kind === "question" && curInd.targetId === q.key ? curInd.position : "before";
|
|
14002
|
+
if (item.kind === "new-type") {
|
|
14003
|
+
const newQ = buildQuestionFromType(
|
|
14004
|
+
item.qType,
|
|
14005
|
+
st.id,
|
|
14006
|
+
questions.map((x) => x.key)
|
|
14007
|
+
);
|
|
14008
|
+
const { draft: nextDraft, insertedIndex } = insertQuestionInMultiStepDraft(draft, newQ, {
|
|
14009
|
+
stepId: st.id,
|
|
14010
|
+
targetQuestionKey: q.key,
|
|
14011
|
+
position: pos
|
|
14012
|
+
});
|
|
14013
|
+
setDraft(nextDraft);
|
|
14014
|
+
setSelectedQuestionIdx(insertedIndex);
|
|
14015
|
+
setActiveStepId(st.id);
|
|
14016
|
+
return;
|
|
14017
|
+
}
|
|
14018
|
+
if (item.kind === "question") {
|
|
14019
|
+
const nextDraft = moveQuestionInMultiStepDraft(
|
|
14020
|
+
draft,
|
|
14021
|
+
item.questionKey,
|
|
14022
|
+
{
|
|
14023
|
+
stepId: st.id,
|
|
14024
|
+
targetQuestionKey: q.key,
|
|
14025
|
+
position: pos
|
|
14026
|
+
}
|
|
14027
|
+
);
|
|
14028
|
+
setDraft(nextDraft);
|
|
14029
|
+
selectQuestionByKey(
|
|
14030
|
+
nextDraft.questions,
|
|
14031
|
+
item.questionKey
|
|
14032
|
+
);
|
|
14033
|
+
setActiveStepId(st.id);
|
|
14034
|
+
}
|
|
14035
|
+
},
|
|
14036
|
+
onClick: (e) => {
|
|
14037
|
+
e.stopPropagation();
|
|
14038
|
+
setSelectedQuestionIdx(qIdx);
|
|
14039
|
+
setActiveStepId(st.id);
|
|
11849
14040
|
},
|
|
11850
|
-
children: [
|
|
11851
|
-
qIdx + 1,
|
|
11852
|
-
". ",
|
|
11853
|
-
qTitle,
|
|
11854
|
-
" ",
|
|
11855
|
-
q.required && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626" }, children: "*" })
|
|
11856
|
-
]
|
|
11857
|
-
}
|
|
11858
|
-
),
|
|
11859
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11860
|
-
"div",
|
|
11861
|
-
{
|
|
11862
14041
|
style: {
|
|
14042
|
+
position: "relative",
|
|
14043
|
+
padding: "8px 10px",
|
|
14044
|
+
borderRadius: 7,
|
|
14045
|
+
border: selected ? "2px solid #2563eb" : "1px solid #cbd5e1",
|
|
14046
|
+
background: selected ? "#eff6ff" : "#f8fafc",
|
|
14047
|
+
cursor: "grab",
|
|
11863
14048
|
display: "flex",
|
|
11864
14049
|
alignItems: "center",
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
color: "#64748b",
|
|
11868
|
-
marginTop: 2
|
|
14050
|
+
justifyContent: "space-between",
|
|
14051
|
+
gap: 8
|
|
11869
14052
|
},
|
|
11870
14053
|
children: [
|
|
11871
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11872
|
-
|
|
11873
|
-
"• ",
|
|
11874
|
-
q.type
|
|
11875
|
-
] }),
|
|
11876
|
-
draft.displayMode === "multi_step" && q.stepId && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: "#1d4ed8", fontWeight: 600 }, children: [
|
|
11877
|
-
"• ",
|
|
11878
|
-
q.stepId
|
|
11879
|
-
] }),
|
|
11880
|
-
hasCond && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11881
|
-
"span",
|
|
14054
|
+
qIndBefore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14055
|
+
"div",
|
|
11882
14056
|
{
|
|
11883
14057
|
style: {
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
14058
|
+
position: "absolute",
|
|
14059
|
+
top: -4,
|
|
14060
|
+
left: 4,
|
|
14061
|
+
right: 4,
|
|
14062
|
+
height: 2.5,
|
|
14063
|
+
borderRadius: 2,
|
|
14064
|
+
background: "#2563eb",
|
|
14065
|
+
zIndex: 4
|
|
14066
|
+
}
|
|
14067
|
+
}
|
|
14068
|
+
),
|
|
14069
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14070
|
+
"div",
|
|
14071
|
+
{
|
|
14072
|
+
style: {
|
|
14073
|
+
display: "flex",
|
|
14074
|
+
alignItems: "center",
|
|
14075
|
+
gap: 7,
|
|
14076
|
+
overflow: "hidden"
|
|
14077
|
+
},
|
|
14078
|
+
children: [
|
|
14079
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14080
|
+
index.MaterialIcon,
|
|
14081
|
+
{
|
|
14082
|
+
name: "drag_indicator",
|
|
14083
|
+
size: 15,
|
|
14084
|
+
color: selected ? "#2563eb" : "#94a3b8"
|
|
14085
|
+
}
|
|
14086
|
+
),
|
|
14087
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { overflow: "hidden" }, children: [
|
|
14088
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14089
|
+
"div",
|
|
14090
|
+
{
|
|
14091
|
+
style: {
|
|
14092
|
+
fontSize: 12,
|
|
14093
|
+
fontWeight: 700,
|
|
14094
|
+
color: "#0f172a",
|
|
14095
|
+
whiteSpace: "nowrap",
|
|
14096
|
+
overflow: "hidden",
|
|
14097
|
+
textOverflow: "ellipsis"
|
|
14098
|
+
},
|
|
14099
|
+
children: [
|
|
14100
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14101
|
+
"span",
|
|
14102
|
+
{
|
|
14103
|
+
style: {
|
|
14104
|
+
color: "#2563eb",
|
|
14105
|
+
marginRight: 4,
|
|
14106
|
+
fontSize: 11
|
|
14107
|
+
},
|
|
14108
|
+
children: [
|
|
14109
|
+
sIdx + 1,
|
|
14110
|
+
".",
|
|
14111
|
+
localIndex + 1
|
|
14112
|
+
]
|
|
14113
|
+
}
|
|
14114
|
+
),
|
|
14115
|
+
qTitle,
|
|
14116
|
+
" ",
|
|
14117
|
+
q.required && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626" }, children: "*" })
|
|
14118
|
+
]
|
|
14119
|
+
}
|
|
14120
|
+
),
|
|
14121
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14122
|
+
"div",
|
|
14123
|
+
{
|
|
14124
|
+
style: {
|
|
14125
|
+
display: "flex",
|
|
14126
|
+
alignItems: "center",
|
|
14127
|
+
gap: 6,
|
|
14128
|
+
fontSize: 10,
|
|
14129
|
+
color: "#64748b",
|
|
14130
|
+
marginTop: 2
|
|
14131
|
+
},
|
|
14132
|
+
children: [
|
|
14133
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: q.key }),
|
|
14134
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
14135
|
+
"• ",
|
|
14136
|
+
q.type
|
|
14137
|
+
] }),
|
|
14138
|
+
hasCond && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14139
|
+
"span",
|
|
14140
|
+
{
|
|
14141
|
+
style: {
|
|
14142
|
+
padding: "1px 5px",
|
|
14143
|
+
borderRadius: 4,
|
|
14144
|
+
background: "#fef3c7",
|
|
14145
|
+
color: "#92400e",
|
|
14146
|
+
fontWeight: 700
|
|
14147
|
+
},
|
|
14148
|
+
children: tr ? "Koşullu" : "Skip Logic"
|
|
14149
|
+
}
|
|
14150
|
+
)
|
|
14151
|
+
]
|
|
14152
|
+
}
|
|
14153
|
+
)
|
|
14154
|
+
] })
|
|
14155
|
+
]
|
|
14156
|
+
}
|
|
14157
|
+
),
|
|
14158
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14159
|
+
"button",
|
|
14160
|
+
{
|
|
14161
|
+
type: "button",
|
|
14162
|
+
onClick: (e) => {
|
|
14163
|
+
e.stopPropagation();
|
|
14164
|
+
removeQuestion(qIdx);
|
|
14165
|
+
},
|
|
14166
|
+
style: {
|
|
14167
|
+
border: "none",
|
|
14168
|
+
background: "transparent",
|
|
14169
|
+
color: "#dc2626",
|
|
14170
|
+
cursor: "pointer",
|
|
14171
|
+
fontSize: 15
|
|
11889
14172
|
},
|
|
11890
|
-
|
|
14173
|
+
title: tr ? "Soruyu sil" : "Delete question",
|
|
14174
|
+
children: "×"
|
|
14175
|
+
}
|
|
14176
|
+
),
|
|
14177
|
+
qIndAfter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14178
|
+
"div",
|
|
14179
|
+
{
|
|
14180
|
+
style: {
|
|
14181
|
+
position: "absolute",
|
|
14182
|
+
bottom: -4,
|
|
14183
|
+
left: 4,
|
|
14184
|
+
right: 4,
|
|
14185
|
+
height: 2.5,
|
|
14186
|
+
borderRadius: 2,
|
|
14187
|
+
background: "#2563eb",
|
|
14188
|
+
zIndex: 4
|
|
14189
|
+
}
|
|
11891
14190
|
}
|
|
11892
14191
|
)
|
|
11893
14192
|
]
|
|
11894
|
-
}
|
|
11895
|
-
|
|
11896
|
-
|
|
14193
|
+
},
|
|
14194
|
+
q.key || qIdx
|
|
14195
|
+
);
|
|
14196
|
+
}),
|
|
14197
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14198
|
+
"button",
|
|
14199
|
+
{
|
|
14200
|
+
type: "button",
|
|
14201
|
+
onClick: (e) => {
|
|
14202
|
+
e.stopPropagation();
|
|
14203
|
+
addQuestionOfType("single_choice", void 0, st.id);
|
|
14204
|
+
},
|
|
14205
|
+
style: {
|
|
14206
|
+
marginTop: 2,
|
|
14207
|
+
padding: "5px 8px",
|
|
14208
|
+
borderRadius: 6,
|
|
14209
|
+
border: "1px dashed #93c5fd",
|
|
14210
|
+
background: "#f8fafc",
|
|
14211
|
+
color: "#1d4ed8",
|
|
14212
|
+
fontSize: 10.5,
|
|
14213
|
+
fontWeight: 700,
|
|
14214
|
+
cursor: "pointer"
|
|
14215
|
+
},
|
|
14216
|
+
children: [
|
|
14217
|
+
"+ ",
|
|
14218
|
+
tr ? "Bu Adıma Soru Ekle" : "Add Question to This Step"
|
|
14219
|
+
]
|
|
14220
|
+
}
|
|
14221
|
+
)
|
|
11897
14222
|
]
|
|
11898
14223
|
}
|
|
11899
14224
|
),
|
|
11900
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11901
|
-
"
|
|
14225
|
+
stepIndicatorAfter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14226
|
+
"div",
|
|
11902
14227
|
{
|
|
11903
|
-
type: "button",
|
|
11904
|
-
onClick: (e) => {
|
|
11905
|
-
e.stopPropagation();
|
|
11906
|
-
removeQuestion(qIdx);
|
|
11907
|
-
},
|
|
11908
14228
|
style: {
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
14229
|
+
position: "absolute",
|
|
14230
|
+
bottom: -5,
|
|
14231
|
+
left: 6,
|
|
14232
|
+
right: 6,
|
|
14233
|
+
height: 3,
|
|
14234
|
+
borderRadius: 3,
|
|
14235
|
+
background: "#2563eb",
|
|
14236
|
+
zIndex: 5
|
|
14237
|
+
}
|
|
11917
14238
|
}
|
|
11918
14239
|
)
|
|
11919
14240
|
]
|
|
11920
14241
|
},
|
|
11921
|
-
|
|
14242
|
+
st.id
|
|
11922
14243
|
);
|
|
11923
14244
|
})
|
|
11924
|
-
}
|
|
14245
|
+
] });
|
|
14246
|
+
})() : (
|
|
14247
|
+
/* SINGLE-PAGE / QUICK-POLL FLAT DRAGGABLE QUESTIONS LIST */
|
|
14248
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14249
|
+
"div",
|
|
14250
|
+
{
|
|
14251
|
+
onDragOver: (e) => {
|
|
14252
|
+
if (dragRef.current?.kind === "question" || dragRef.current?.kind === "new-type") {
|
|
14253
|
+
e.preventDefault();
|
|
14254
|
+
}
|
|
14255
|
+
},
|
|
14256
|
+
onDrop: (e) => {
|
|
14257
|
+
e.preventDefault();
|
|
14258
|
+
if (dragRef.current?.kind === "new-type") {
|
|
14259
|
+
const t = dragRef.current.qType;
|
|
14260
|
+
dragRef.current = null;
|
|
14261
|
+
setDropIndicator(null);
|
|
14262
|
+
addQuestionOfType(t);
|
|
14263
|
+
}
|
|
14264
|
+
},
|
|
14265
|
+
style: { display: "flex", flexDirection: "column", gap: 7 },
|
|
14266
|
+
children: questions.map((q, qIdx) => {
|
|
14267
|
+
const selected = qIdx === selectedQuestionIdx;
|
|
14268
|
+
const qTitle = pickTextForLocale(q.title, uiLocale, q.key);
|
|
14269
|
+
const hasCond = q.conditions && Array.isArray(q.conditions.rules) && q.conditions.rules.length > 0;
|
|
14270
|
+
const qIndBefore = dropIndicator?.kind === "question" && dropIndicator.targetId === q.key && dropIndicator.position === "before";
|
|
14271
|
+
const qIndAfter = dropIndicator?.kind === "question" && dropIndicator.targetId === q.key && dropIndicator.position === "after";
|
|
14272
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14273
|
+
"div",
|
|
14274
|
+
{
|
|
14275
|
+
draggable: true,
|
|
14276
|
+
onDragStart: (e) => {
|
|
14277
|
+
dragRef.current = {
|
|
14278
|
+
kind: "question",
|
|
14279
|
+
index: qIdx,
|
|
14280
|
+
questionKey: q.key
|
|
14281
|
+
};
|
|
14282
|
+
e.dataTransfer.setData("text/plain", q.key);
|
|
14283
|
+
},
|
|
14284
|
+
onDragEnd: () => {
|
|
14285
|
+
dragRef.current = null;
|
|
14286
|
+
setDropIndicator(null);
|
|
14287
|
+
},
|
|
14288
|
+
onDragOver: (e) => {
|
|
14289
|
+
if (dragRef.current?.kind === "question" || dragRef.current?.kind === "new-type") {
|
|
14290
|
+
e.preventDefault();
|
|
14291
|
+
e.stopPropagation();
|
|
14292
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
14293
|
+
const pos = e.clientY - rect.top < rect.height / 2 ? "before" : "after";
|
|
14294
|
+
setDropIndicator({
|
|
14295
|
+
kind: "question",
|
|
14296
|
+
targetId: q.key,
|
|
14297
|
+
position: pos
|
|
14298
|
+
});
|
|
14299
|
+
}
|
|
14300
|
+
},
|
|
14301
|
+
onDrop: (e) => {
|
|
14302
|
+
e.preventDefault();
|
|
14303
|
+
e.stopPropagation();
|
|
14304
|
+
const item = dragRef.current;
|
|
14305
|
+
const curInd = dropIndicator;
|
|
14306
|
+
dragRef.current = null;
|
|
14307
|
+
setDropIndicator(null);
|
|
14308
|
+
if (!item) return;
|
|
14309
|
+
const pos = curInd?.kind === "question" && curInd.targetId === q.key ? curInd.position : "before";
|
|
14310
|
+
if (item.kind === "new-type") {
|
|
14311
|
+
const insIdx = pos === "after" ? qIdx + 1 : qIdx;
|
|
14312
|
+
addQuestionOfType(item.qType, insIdx);
|
|
14313
|
+
return;
|
|
14314
|
+
}
|
|
14315
|
+
if (item.kind === "question" && item.questionKey !== q.key) {
|
|
14316
|
+
const next = reorderFlatQuestions(
|
|
14317
|
+
questions,
|
|
14318
|
+
item.questionKey,
|
|
14319
|
+
q.key,
|
|
14320
|
+
pos
|
|
14321
|
+
);
|
|
14322
|
+
setDraft((prev) => ({ ...prev, questions: next }));
|
|
14323
|
+
selectQuestionByKey(next, item.questionKey);
|
|
14324
|
+
}
|
|
14325
|
+
},
|
|
14326
|
+
onClick: () => setSelectedQuestionIdx(qIdx),
|
|
14327
|
+
style: {
|
|
14328
|
+
position: "relative",
|
|
14329
|
+
padding: "9px 10px",
|
|
14330
|
+
borderRadius: 8,
|
|
14331
|
+
border: selected ? "2px solid #2563eb" : "1px solid #cbd5e1",
|
|
14332
|
+
background: selected ? "#eff6ff" : "#ffffff",
|
|
14333
|
+
cursor: "grab",
|
|
14334
|
+
display: "flex",
|
|
14335
|
+
alignItems: "center",
|
|
14336
|
+
justifyContent: "space-between",
|
|
14337
|
+
gap: 8
|
|
14338
|
+
},
|
|
14339
|
+
children: [
|
|
14340
|
+
qIndBefore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14341
|
+
"div",
|
|
14342
|
+
{
|
|
14343
|
+
style: {
|
|
14344
|
+
position: "absolute",
|
|
14345
|
+
top: -4,
|
|
14346
|
+
left: 4,
|
|
14347
|
+
right: 4,
|
|
14348
|
+
height: 2.5,
|
|
14349
|
+
borderRadius: 2,
|
|
14350
|
+
background: "#2563eb",
|
|
14351
|
+
zIndex: 4
|
|
14352
|
+
}
|
|
14353
|
+
}
|
|
14354
|
+
),
|
|
14355
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14356
|
+
"div",
|
|
14357
|
+
{
|
|
14358
|
+
style: {
|
|
14359
|
+
display: "flex",
|
|
14360
|
+
alignItems: "center",
|
|
14361
|
+
gap: 7,
|
|
14362
|
+
overflow: "hidden"
|
|
14363
|
+
},
|
|
14364
|
+
children: [
|
|
14365
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14366
|
+
index.MaterialIcon,
|
|
14367
|
+
{
|
|
14368
|
+
name: "drag_indicator",
|
|
14369
|
+
size: 16,
|
|
14370
|
+
color: selected ? "#2563eb" : "#94a3b8"
|
|
14371
|
+
}
|
|
14372
|
+
),
|
|
14373
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { overflow: "hidden" }, children: [
|
|
14374
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14375
|
+
"div",
|
|
14376
|
+
{
|
|
14377
|
+
style: {
|
|
14378
|
+
fontSize: 12,
|
|
14379
|
+
fontWeight: 700,
|
|
14380
|
+
color: "#0f172a",
|
|
14381
|
+
whiteSpace: "nowrap",
|
|
14382
|
+
overflow: "hidden",
|
|
14383
|
+
textOverflow: "ellipsis"
|
|
14384
|
+
},
|
|
14385
|
+
children: [
|
|
14386
|
+
qIdx + 1,
|
|
14387
|
+
". ",
|
|
14388
|
+
qTitle,
|
|
14389
|
+
" ",
|
|
14390
|
+
q.required && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626" }, children: "*" })
|
|
14391
|
+
]
|
|
14392
|
+
}
|
|
14393
|
+
),
|
|
14394
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14395
|
+
"div",
|
|
14396
|
+
{
|
|
14397
|
+
style: {
|
|
14398
|
+
display: "flex",
|
|
14399
|
+
alignItems: "center",
|
|
14400
|
+
gap: 6,
|
|
14401
|
+
fontSize: 10,
|
|
14402
|
+
color: "#64748b",
|
|
14403
|
+
marginTop: 2
|
|
14404
|
+
},
|
|
14405
|
+
children: [
|
|
14406
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: q.key }),
|
|
14407
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
14408
|
+
"• ",
|
|
14409
|
+
q.type
|
|
14410
|
+
] }),
|
|
14411
|
+
hasCond && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14412
|
+
"span",
|
|
14413
|
+
{
|
|
14414
|
+
style: {
|
|
14415
|
+
padding: "1px 5px",
|
|
14416
|
+
borderRadius: 4,
|
|
14417
|
+
background: "#fef3c7",
|
|
14418
|
+
color: "#92400e",
|
|
14419
|
+
fontWeight: 700
|
|
14420
|
+
},
|
|
14421
|
+
children: tr ? "Koşullu" : "Skip Logic"
|
|
14422
|
+
}
|
|
14423
|
+
)
|
|
14424
|
+
]
|
|
14425
|
+
}
|
|
14426
|
+
)
|
|
14427
|
+
] })
|
|
14428
|
+
]
|
|
14429
|
+
}
|
|
14430
|
+
),
|
|
14431
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14432
|
+
"button",
|
|
14433
|
+
{
|
|
14434
|
+
type: "button",
|
|
14435
|
+
onClick: (e) => {
|
|
14436
|
+
e.stopPropagation();
|
|
14437
|
+
removeQuestion(qIdx);
|
|
14438
|
+
},
|
|
14439
|
+
style: {
|
|
14440
|
+
border: "none",
|
|
14441
|
+
background: "transparent",
|
|
14442
|
+
color: "#dc2626",
|
|
14443
|
+
cursor: "pointer",
|
|
14444
|
+
fontSize: 15
|
|
14445
|
+
},
|
|
14446
|
+
title: tr ? "Soruyu sil" : "Delete question",
|
|
14447
|
+
children: "×"
|
|
14448
|
+
}
|
|
14449
|
+
),
|
|
14450
|
+
qIndAfter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14451
|
+
"div",
|
|
14452
|
+
{
|
|
14453
|
+
style: {
|
|
14454
|
+
position: "absolute",
|
|
14455
|
+
bottom: -4,
|
|
14456
|
+
left: 4,
|
|
14457
|
+
right: 4,
|
|
14458
|
+
height: 2.5,
|
|
14459
|
+
borderRadius: 2,
|
|
14460
|
+
background: "#2563eb",
|
|
14461
|
+
zIndex: 4
|
|
14462
|
+
}
|
|
14463
|
+
}
|
|
14464
|
+
)
|
|
14465
|
+
]
|
|
14466
|
+
},
|
|
14467
|
+
q.key || qIdx
|
|
14468
|
+
);
|
|
14469
|
+
})
|
|
14470
|
+
}
|
|
14471
|
+
)
|
|
11925
14472
|
)
|
|
11926
14473
|
]
|
|
11927
14474
|
}
|
|
@@ -12013,7 +14560,17 @@ const SurveyStudioModal = ({
|
|
|
12013
14560
|
"select",
|
|
12014
14561
|
{
|
|
12015
14562
|
value: activeQ.stepId || steps[0]?.id || "",
|
|
12016
|
-
onChange: (e) =>
|
|
14563
|
+
onChange: (e) => {
|
|
14564
|
+
const nextStepId = e.target.value;
|
|
14565
|
+
const nextDraft = moveQuestionInMultiStepDraft(draft, activeQ.key, {
|
|
14566
|
+
stepId: nextStepId,
|
|
14567
|
+
position: "end"
|
|
14568
|
+
});
|
|
14569
|
+
setDraft(nextDraft);
|
|
14570
|
+
selectQuestionByKey(nextDraft.questions, activeQ.key);
|
|
14571
|
+
setActiveStepId(nextStepId);
|
|
14572
|
+
setCollapsedStepIds((prev) => ({ ...prev, [nextStepId]: false }));
|
|
14573
|
+
},
|
|
12017
14574
|
style: inputStyle,
|
|
12018
14575
|
children: steps.map((st) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: st.id, children: pickTextForLocale(st.title, uiLocale, st.id) }, st.id))
|
|
12019
14576
|
}
|
|
@@ -13544,7 +16101,72 @@ const SurveyStudioModal = ({
|
|
|
13544
16101
|
strapiLocales
|
|
13545
16102
|
}
|
|
13546
16103
|
),
|
|
13547
|
-
tab === "analytics" && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, padding: 20, overflowY: "auto", background: "#f8fafc" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16104
|
+
tab === "analytics" && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, padding: 20, overflowY: "auto", background: "#f8fafc" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
16105
|
+
SurveyAnalyticsView,
|
|
16106
|
+
{
|
|
16107
|
+
surveySlugOrId: draft.slug,
|
|
16108
|
+
uiLocale
|
|
16109
|
+
},
|
|
16110
|
+
`${draft.slug}-${studioAnalyticsKey}`
|
|
16111
|
+
) }),
|
|
16112
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16113
|
+
SurveyExportModal,
|
|
16114
|
+
{
|
|
16115
|
+
open: studioExportOpen,
|
|
16116
|
+
uiLocale,
|
|
16117
|
+
targetSurvey: draft,
|
|
16118
|
+
allowAllSurveys: false,
|
|
16119
|
+
isUnsavedDraft: !draft.id && !draft.documentId && !draft._id,
|
|
16120
|
+
onClose: () => setStudioExportOpen(false)
|
|
16121
|
+
}
|
|
16122
|
+
),
|
|
16123
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16124
|
+
SurveyImportModal,
|
|
16125
|
+
{
|
|
16126
|
+
open: studioImportOpen,
|
|
16127
|
+
uiLocale,
|
|
16128
|
+
existingSlugs: draft.slug ? [draft.slug] : [],
|
|
16129
|
+
onClose: () => setStudioImportOpen(false),
|
|
16130
|
+
onImported: (res) => {
|
|
16131
|
+
const first = res.importedSurveys?.[0];
|
|
16132
|
+
if (first) {
|
|
16133
|
+
const nextDraft = first.displayMode === "multi_step" ? normalizeMultiStepDraft(JSON.parse(JSON.stringify(first))) : JSON.parse(JSON.stringify(first));
|
|
16134
|
+
setDraft(nextDraft);
|
|
16135
|
+
setSelectedQuestionIdx(0);
|
|
16136
|
+
setActiveStepId(nextDraft.steps?.[0]?.id || "step_1");
|
|
16137
|
+
setStudioAnalyticsKey((k) => k + 1);
|
|
16138
|
+
setStatusMsg(
|
|
16139
|
+
tr ? `İçe aktarıldı (${res.importedResponsesCount} yanıt)!` : `Imported (${res.importedResponsesCount} responses)!`
|
|
16140
|
+
);
|
|
16141
|
+
if (typeof window !== "undefined") {
|
|
16142
|
+
window.dispatchEvent(new CustomEvent("ci-survey-updated", { detail: first }));
|
|
16143
|
+
}
|
|
16144
|
+
onSaved?.(first);
|
|
16145
|
+
}
|
|
16146
|
+
}
|
|
16147
|
+
}
|
|
16148
|
+
),
|
|
16149
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16150
|
+
SurveyCleanupConfirmModal,
|
|
16151
|
+
{
|
|
16152
|
+
open: Boolean(studioCleanupAction),
|
|
16153
|
+
action: studioCleanupAction,
|
|
16154
|
+
uiLocale,
|
|
16155
|
+
targetSurvey: draft,
|
|
16156
|
+
onClose: () => setStudioCleanupAction(null),
|
|
16157
|
+
onCompleted: (act, payload) => {
|
|
16158
|
+
if (act === "clear-responses") {
|
|
16159
|
+
const updatedDraft = { ...draft, responseCount: 0, npsScore: null };
|
|
16160
|
+
setDraft(updatedDraft);
|
|
16161
|
+
setStudioAnalyticsKey((k) => k + 1);
|
|
16162
|
+
setStatusMsg(
|
|
16163
|
+
tr ? `${payload?.deletedCount || 0} yanıt sıfırlandı.` : `Cleared ${payload?.deletedCount || 0} response(s).`
|
|
16164
|
+
);
|
|
16165
|
+
onSaved?.(updatedDraft);
|
|
16166
|
+
}
|
|
16167
|
+
}
|
|
16168
|
+
}
|
|
16169
|
+
)
|
|
13548
16170
|
]
|
|
13549
16171
|
}
|
|
13550
16172
|
)
|
|
@@ -13605,13 +16227,13 @@ const SurveyWidgetEditor = ({ widget, onChange }) => {
|
|
|
13605
16227
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13606
16228
|
"select",
|
|
13607
16229
|
{
|
|
13608
|
-
value: matchedSurvey?.slug || selectedRef,
|
|
16230
|
+
value: matchedSurvey?.slug || (surveysList.length > 0 ? selectedRef : ""),
|
|
13609
16231
|
onChange: (e) => {
|
|
13610
16232
|
const chosen = surveysList.find((s) => s.slug === e.target.value);
|
|
13611
16233
|
if (chosen) bindSurveyToWidget(chosen);
|
|
13612
16234
|
},
|
|
13613
16235
|
style: inputStyle,
|
|
13614
|
-
children: surveysList.map((s) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: s.slug, children: [
|
|
16236
|
+
children: surveysList.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: tr ? "Henüz kayıtlı anket yok — Yeni yaratın veya JSON yükleyin" : "No surveys yet — Create new or Import JSON" }) : surveysList.map((s) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: s.slug, children: [
|
|
13615
16237
|
pickTextForLocale(s.titleI18n, locale, s.title),
|
|
13616
16238
|
" (",
|
|
13617
16239
|
s.responseCount ?? 0,
|
|
@@ -13817,6 +16439,9 @@ exports.EditorProvider = EditorProvider;
|
|
|
13817
16439
|
exports.ROW_PRESETS = ROW_PRESETS;
|
|
13818
16440
|
exports.StrapiMediaPicker = StrapiMediaPicker;
|
|
13819
16441
|
exports.SurveyAnalyticsView = SurveyAnalyticsView;
|
|
16442
|
+
exports.SurveyCleanupConfirmModal = SurveyCleanupConfirmModal;
|
|
16443
|
+
exports.SurveyExportModal = SurveyExportModal;
|
|
16444
|
+
exports.SurveyImportModal = SurveyImportModal;
|
|
13820
16445
|
exports.SurveyStudioModal = SurveyStudioModal;
|
|
13821
16446
|
exports.SurveyWidgetEditor = SurveyWidgetEditor;
|
|
13822
16447
|
exports.WIDGET_CATEGORIES = WIDGET_CATEGORIES;
|