@ozguraltan/strapi-content-input 1.0.24 → 1.0.26
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 +2 -0
- package/dist/admin/{AnalyticsHubPage-ByOrVZCl.js → AnalyticsHubPage-CHlhvUIU.js} +2 -2
- package/dist/admin/{AnalyticsHubPage-O-7pF2E5.mjs → AnalyticsHubPage-Crz4vv46.mjs} +2 -2
- package/dist/admin/{ContentInputField-BoZHf0Ka.mjs → ContentInputField-BeKDx_bb.mjs} +64 -19
- package/dist/admin/{ContentInputField-DK97AIG0.js → ContentInputField-CNWVLuRt.js} +64 -19
- package/dist/admin/{SurveyWidgetEditor-D3KiAotu.js → SurveyWidgetEditor-BTipBBEU.js} +622 -152
- package/dist/admin/{SurveyWidgetEditor-Y5BR-NWE.mjs → SurveyWidgetEditor-GKRT3eHj.mjs} +622 -152
- package/dist/admin/{index-C5Uj5YV9.mjs → index-DSDcG4QW.mjs} +2 -2
- package/dist/admin/{index-CHtB_Fa5.js → index-DuJM60tO.js} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/widgets/SurveyWidgetEditor.d.ts +2 -0
- package/dist/server/index.js +132 -27
- package/dist/server/index.mjs +132 -27
- package/dist/server/src/index.d.ts +23 -0
- package/dist/server/src/services/ci-survey.d.ts +23 -0
- package/dist/server/src/services/index.d.ts +23 -0
- package/dist/server/src/utils/surveyEngine.d.ts +19 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ 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-DuJM60tO.js");
|
|
7
7
|
const cloneDeep = require("lodash/cloneDeep");
|
|
8
8
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
9
9
|
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
@@ -8090,7 +8090,7 @@ const SurveyAnalyticsView = ({
|
|
|
8090
8090
|
style: {
|
|
8091
8091
|
width: `${Math.min(100, opt.percentage)}%`,
|
|
8092
8092
|
height: "100%",
|
|
8093
|
-
background: opt.id === "__other__" ? "#64748b" : "linear-gradient(90deg, #2563eb 0%, #3b82f6 100%)",
|
|
8093
|
+
background: opt.id === "__other__" ? "#64748b" : opt.id === "__na__" ? "#94a3b8" : "linear-gradient(90deg, #2563eb 0%, #3b82f6 100%)",
|
|
8094
8094
|
borderRadius: 5
|
|
8095
8095
|
}
|
|
8096
8096
|
}
|
|
@@ -8218,6 +8218,37 @@ const SurveyAnalyticsView = ({
|
|
|
8218
8218
|
")"
|
|
8219
8219
|
]
|
|
8220
8220
|
}
|
|
8221
|
+
),
|
|
8222
|
+
(qs.noOpinionCount > 0 || qs.allowNoOpinion) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8223
|
+
"div",
|
|
8224
|
+
{
|
|
8225
|
+
style: {
|
|
8226
|
+
padding: "8px 14px",
|
|
8227
|
+
borderRadius: 8,
|
|
8228
|
+
background: "#f1f5f9",
|
|
8229
|
+
border: "1px dashed #94a3b8",
|
|
8230
|
+
fontSize: 11.5,
|
|
8231
|
+
color: "#334155",
|
|
8232
|
+
fontWeight: 700
|
|
8233
|
+
},
|
|
8234
|
+
children: [
|
|
8235
|
+
pickTextForLocale(
|
|
8236
|
+
qs.noOpinionLabels,
|
|
8237
|
+
uiLocale,
|
|
8238
|
+
tr ? "Fikrim yok" : "No idea"
|
|
8239
|
+
),
|
|
8240
|
+
": ",
|
|
8241
|
+
qs.noOpinionCount || 0,
|
|
8242
|
+
" (",
|
|
8243
|
+
qs.noOpinionPercentage || 0,
|
|
8244
|
+
"%)",
|
|
8245
|
+
" ",
|
|
8246
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 500, color: "#64748b", fontSize: 10.5 }, children: [
|
|
8247
|
+
"• ",
|
|
8248
|
+
tr ? "ortalamaya katılmaz" : "excluded from avg"
|
|
8249
|
+
] })
|
|
8250
|
+
]
|
|
8251
|
+
}
|
|
8221
8252
|
)
|
|
8222
8253
|
]
|
|
8223
8254
|
}
|
|
@@ -8387,102 +8418,131 @@ const SurveyAnalyticsView = ({
|
|
|
8387
8418
|
]
|
|
8388
8419
|
}
|
|
8389
8420
|
) }),
|
|
8390
|
-
qs.type === "ranking" && Array.isArray(qs.rankingBreakdown) && /* @__PURE__ */ jsxRuntime.
|
|
8391
|
-
|
|
8392
|
-
1,
|
|
8393
|
-
...qs.rankingBreakdown.map((x) => x.bordaPoints || 0)
|
|
8394
|
-
);
|
|
8395
|
-
const pct = Math.round((rk.bordaPoints || 0) / maxBorda * 100);
|
|
8396
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8421
|
+
qs.type === "ranking" && Array.isArray(qs.rankingBreakdown) && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
8422
|
+
(qs.noOpinionCount > 0 || qs.allowNoOpinion) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8397
8423
|
"div",
|
|
8398
8424
|
{
|
|
8399
8425
|
style: {
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
background:
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
flexWrap: "wrap"
|
|
8426
|
+
alignSelf: "flex-start",
|
|
8427
|
+
padding: "5px 11px",
|
|
8428
|
+
borderRadius: 7,
|
|
8429
|
+
background: "#f1f5f9",
|
|
8430
|
+
border: "1px dashed #94a3b8",
|
|
8431
|
+
fontSize: 11,
|
|
8432
|
+
fontWeight: 700,
|
|
8433
|
+
color: "#334155"
|
|
8409
8434
|
},
|
|
8410
8435
|
children: [
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8436
|
+
pickTextForLocale(
|
|
8437
|
+
qs.noOpinionLabels,
|
|
8438
|
+
uiLocale,
|
|
8439
|
+
tr ? "Fikrim yok" : "No idea"
|
|
8440
|
+
),
|
|
8441
|
+
": ",
|
|
8442
|
+
qs.noOpinionCount || 0,
|
|
8443
|
+
" (",
|
|
8444
|
+
qs.noOpinionPercentage || 0,
|
|
8445
|
+
"%)"
|
|
8446
|
+
]
|
|
8447
|
+
}
|
|
8448
|
+
),
|
|
8449
|
+
qs.rankingBreakdown.map((rk, idx) => {
|
|
8450
|
+
const maxBorda = Math.max(
|
|
8451
|
+
1,
|
|
8452
|
+
...qs.rankingBreakdown.map((x) => x.bordaPoints || 0)
|
|
8453
|
+
);
|
|
8454
|
+
const pct = Math.round((rk.bordaPoints || 0) / maxBorda * 100);
|
|
8455
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8456
|
+
"div",
|
|
8457
|
+
{
|
|
8458
|
+
style: {
|
|
8459
|
+
padding: "10px 12px",
|
|
8460
|
+
borderRadius: 8,
|
|
8461
|
+
border: idx === 0 ? "1.5px solid #f59e0b" : "1px solid #e2e8f0",
|
|
8462
|
+
background: idx === 0 ? "#fffbeb" : "#f8fafc",
|
|
8463
|
+
display: "flex",
|
|
8464
|
+
alignItems: "center",
|
|
8465
|
+
justifyContent: "space-between",
|
|
8466
|
+
gap: 12,
|
|
8467
|
+
flexWrap: "wrap"
|
|
8468
|
+
},
|
|
8469
|
+
children: [
|
|
8470
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
8471
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8472
|
+
"span",
|
|
8473
|
+
{
|
|
8474
|
+
style: {
|
|
8475
|
+
width: 26,
|
|
8476
|
+
height: 26,
|
|
8477
|
+
borderRadius: "50%",
|
|
8478
|
+
background: idx === 0 ? "#f59e0b" : idx === 1 ? "#64748b" : idx === 2 ? "#b45309" : "#cbd5e1",
|
|
8479
|
+
color: "#fff",
|
|
8480
|
+
fontWeight: 800,
|
|
8481
|
+
fontSize: 12,
|
|
8482
|
+
display: "inline-flex",
|
|
8483
|
+
alignItems: "center",
|
|
8484
|
+
justifyContent: "center"
|
|
8485
|
+
},
|
|
8486
|
+
children: [
|
|
8487
|
+
"#",
|
|
8488
|
+
idx + 1
|
|
8489
|
+
]
|
|
8490
|
+
}
|
|
8491
|
+
),
|
|
8492
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
8493
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 13, fontWeight: 700, color: "#0f172a" }, children: pickTextForLocale(rk.labels, uiLocale, rk.id) }),
|
|
8494
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, color: "#64748b" }, children: [
|
|
8495
|
+
tr ? "Ort. Sıra:" : "Avg Rank:",
|
|
8496
|
+
" ",
|
|
8497
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: rk.averageRank ?? rk.avgRank ?? "-" }),
|
|
8498
|
+
" •",
|
|
8499
|
+
" ",
|
|
8500
|
+
tr ? "1. Sıra Tercihi:" : "#1 Votes:",
|
|
8501
|
+
" ",
|
|
8502
|
+
/* @__PURE__ */ jsxRuntime.jsxs("strong", { children: [
|
|
8503
|
+
rk.firstPlaceCount ?? rk.firstPlaceVotes ?? 0,
|
|
8504
|
+
" (",
|
|
8505
|
+
rk.firstPlacePercentage,
|
|
8506
|
+
"%)"
|
|
8507
|
+
] })
|
|
8448
8508
|
] })
|
|
8449
8509
|
] })
|
|
8450
|
-
] })
|
|
8451
|
-
] }),
|
|
8452
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 150, textAlign: "right" }, children: [
|
|
8453
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, fontWeight: 700, color: "#1e3a8a" }, children: [
|
|
8454
|
-
rk.bordaPoints,
|
|
8455
|
-
" ",
|
|
8456
|
-
tr ? "Borda Puanı" : "Borda pts"
|
|
8457
8510
|
] }),
|
|
8458
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8459
|
-
"div",
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8511
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 150, textAlign: "right" }, children: [
|
|
8512
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, fontWeight: 700, color: "#1e3a8a" }, children: [
|
|
8513
|
+
rk.bordaPoints,
|
|
8514
|
+
" ",
|
|
8515
|
+
tr ? "Borda Puanı" : "Borda pts"
|
|
8516
|
+
] }),
|
|
8517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8518
|
+
"div",
|
|
8519
|
+
{
|
|
8520
|
+
style: {
|
|
8521
|
+
height: 6,
|
|
8522
|
+
borderRadius: 4,
|
|
8523
|
+
background: "#e2e8f0",
|
|
8524
|
+
marginTop: 4,
|
|
8525
|
+
overflow: "hidden"
|
|
8526
|
+
},
|
|
8527
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8528
|
+
"div",
|
|
8529
|
+
{
|
|
8530
|
+
style: {
|
|
8531
|
+
width: `${pct}%`,
|
|
8532
|
+
height: "100%",
|
|
8533
|
+
background: "#2563eb"
|
|
8534
|
+
}
|
|
8475
8535
|
}
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
)
|
|
8480
|
-
]
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
)
|
|
8485
|
-
|
|
8536
|
+
)
|
|
8537
|
+
}
|
|
8538
|
+
)
|
|
8539
|
+
] })
|
|
8540
|
+
]
|
|
8541
|
+
},
|
|
8542
|
+
rk.id
|
|
8543
|
+
);
|
|
8544
|
+
})
|
|
8545
|
+
] }),
|
|
8486
8546
|
qs.type === "consent" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
8487
8547
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8488
8548
|
"div",
|
|
@@ -8916,6 +8976,18 @@ const SurveyLivePreviewPane = ({
|
|
|
8916
8976
|
}
|
|
8917
8977
|
if (generalError) setGeneralError("");
|
|
8918
8978
|
};
|
|
8979
|
+
const getNoOpinionLabel = (q) => pickTextForLocale(q.noOpinionLabel, testLocale, trTest ? "Fikrim yok" : "No idea");
|
|
8980
|
+
const clearOptionalQuestionAnswer = (q) => {
|
|
8981
|
+
if (q.type === "multiple_choice" || q.type === "image_choice" && (q.maxSelections ?? 1) > 1) {
|
|
8982
|
+
setAnswer(q.key, []);
|
|
8983
|
+
} else if (q.type === "matrix_single") {
|
|
8984
|
+
setAnswer(q.key, {});
|
|
8985
|
+
} else if (q.type === "short_text" || q.type === "long_text") {
|
|
8986
|
+
setAnswer(q.key, "");
|
|
8987
|
+
} else {
|
|
8988
|
+
setAnswer(q.key, null);
|
|
8989
|
+
}
|
|
8990
|
+
};
|
|
8919
8991
|
const validateTargetQuestions = (qs) => {
|
|
8920
8992
|
const nextErrs = {};
|
|
8921
8993
|
for (const q of qs) {
|
|
@@ -8942,11 +9014,12 @@ const SurveyLivePreviewPane = ({
|
|
|
8942
9014
|
}
|
|
8943
9015
|
} else if (q.type === "multiple_choice" || q.type === "image_choice" && (q.maxSelections ?? 1) > 1) {
|
|
8944
9016
|
const arr = Array.isArray(val) ? val : [];
|
|
9017
|
+
const isExclusiveNoOp = Boolean(q.allowNoOpinion && arr.includes("__na__"));
|
|
8945
9018
|
if (q.required && arr.length === 0) {
|
|
8946
9019
|
qErrs.push(
|
|
8947
9020
|
trTest ? "Lütfen en az bir seçenek işaretleyiniz." : "Please select at least one option."
|
|
8948
9021
|
);
|
|
8949
|
-
} else if (arr.length > 0) {
|
|
9022
|
+
} else if (arr.length > 0 && !isExclusiveNoOp) {
|
|
8950
9023
|
if (q.minSelections && arr.length < q.minSelections) {
|
|
8951
9024
|
qErrs.push(
|
|
8952
9025
|
trTest ? `En az ${q.minSelections} seçenek işaretlemelisiniz.` : `Please select at least ${q.minSelections} options.`
|
|
@@ -8958,7 +9031,7 @@ const SurveyLivePreviewPane = ({
|
|
|
8958
9031
|
);
|
|
8959
9032
|
}
|
|
8960
9033
|
}
|
|
8961
|
-
if (q.allowOther && arr.includes("__other__") && !String(otherTexts[q.key] || "").trim()) {
|
|
9034
|
+
if (!isExclusiveNoOp && q.allowOther && arr.includes("__other__") && !String(otherTexts[q.key] || "").trim()) {
|
|
8962
9035
|
qErrs.push(
|
|
8963
9036
|
trTest ? 'Lütfen "Diğer" seçeneği için açıklama giriniz.' : 'Please specify your "Other" choice.'
|
|
8964
9037
|
);
|
|
@@ -9535,7 +9608,7 @@ const SurveyLivePreviewPane = ({
|
|
|
9535
9608
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 12, color: "#334155", marginTop: 4 }, children: [
|
|
9536
9609
|
/* @__PURE__ */ jsxRuntime.jsx("strong", { children: trTest ? "Yanıtınız:" : "Your answer:" }),
|
|
9537
9610
|
" ",
|
|
9538
|
-
typeof ans === "object" ? JSON.stringify(ans) : String(ans ?? "—")
|
|
9611
|
+
ans === "__na__" || Array.isArray(ans) && ans[0] === "__na__" ? getNoOpinionLabel(q) : typeof ans === "object" ? JSON.stringify(ans) : String(ans ?? "—")
|
|
9539
9612
|
] })
|
|
9540
9613
|
]
|
|
9541
9614
|
},
|
|
@@ -9732,11 +9805,45 @@ const SurveyLivePreviewPane = ({
|
|
|
9732
9805
|
},
|
|
9733
9806
|
children: [
|
|
9734
9807
|
q.type !== "consent" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: 10 }, children: [
|
|
9735
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9808
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
9809
|
+
"div",
|
|
9810
|
+
{
|
|
9811
|
+
style: {
|
|
9812
|
+
display: "flex",
|
|
9813
|
+
alignItems: "center",
|
|
9814
|
+
justifyContent: "space-between",
|
|
9815
|
+
gap: 8
|
|
9816
|
+
},
|
|
9817
|
+
children: [
|
|
9818
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 14.5, fontWeight: 700, color: "#0f172a" }, children: [
|
|
9819
|
+
qTitle,
|
|
9820
|
+
" ",
|
|
9821
|
+
q.required && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#dc2626" }, children: "*" })
|
|
9822
|
+
] }),
|
|
9823
|
+
!q.required && q.type !== "ranking" && q.type !== "short_text" && q.type !== "long_text" && !isEmptyVal(val) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9824
|
+
"button",
|
|
9825
|
+
{
|
|
9826
|
+
type: "button",
|
|
9827
|
+
onClick: () => clearOptionalQuestionAnswer(q),
|
|
9828
|
+
style: {
|
|
9829
|
+
border: "none",
|
|
9830
|
+
background: "transparent",
|
|
9831
|
+
color: "#64748b",
|
|
9832
|
+
fontSize: 11,
|
|
9833
|
+
fontWeight: 600,
|
|
9834
|
+
cursor: "pointer",
|
|
9835
|
+
padding: "2px 6px",
|
|
9836
|
+
flexShrink: 0
|
|
9837
|
+
},
|
|
9838
|
+
children: [
|
|
9839
|
+
"× ",
|
|
9840
|
+
trTest ? "Seçimi Temizle" : "Clear"
|
|
9841
|
+
]
|
|
9842
|
+
}
|
|
9843
|
+
)
|
|
9844
|
+
]
|
|
9845
|
+
}
|
|
9846
|
+
),
|
|
9740
9847
|
qDesc && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "#64748b", marginTop: 3 }, children: qDesc })
|
|
9741
9848
|
] }),
|
|
9742
9849
|
q.type === "single_choice" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
@@ -9817,6 +9924,36 @@ const SurveyLivePreviewPane = ({
|
|
|
9817
9924
|
) })
|
|
9818
9925
|
]
|
|
9819
9926
|
}
|
|
9927
|
+
),
|
|
9928
|
+
q.allowNoOpinion && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9929
|
+
"label",
|
|
9930
|
+
{
|
|
9931
|
+
style: {
|
|
9932
|
+
display: "inline-flex",
|
|
9933
|
+
alignItems: "center",
|
|
9934
|
+
gap: 9,
|
|
9935
|
+
padding: "9px 12px",
|
|
9936
|
+
borderRadius: 8,
|
|
9937
|
+
border: val === "__na__" ? "1.5px solid #475569" : "1px dashed #94a3b8",
|
|
9938
|
+
background: val === "__na__" ? "#f1f5f9" : "#ffffff",
|
|
9939
|
+
color: "#334155",
|
|
9940
|
+
fontSize: 13,
|
|
9941
|
+
fontWeight: val === "__na__" ? 700 : 500,
|
|
9942
|
+
cursor: "pointer"
|
|
9943
|
+
},
|
|
9944
|
+
children: [
|
|
9945
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9946
|
+
"input",
|
|
9947
|
+
{
|
|
9948
|
+
type: "radio",
|
|
9949
|
+
name: `prev-${q.key}`,
|
|
9950
|
+
checked: val === "__na__",
|
|
9951
|
+
onChange: () => setAnswer(q.key, "__na__")
|
|
9952
|
+
}
|
|
9953
|
+
),
|
|
9954
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getNoOpinionLabel(q) })
|
|
9955
|
+
]
|
|
9956
|
+
}
|
|
9820
9957
|
)
|
|
9821
9958
|
]
|
|
9822
9959
|
}
|
|
@@ -9874,7 +10011,8 @@ const SurveyLivePreviewPane = ({
|
|
|
9874
10011
|
type: "checkbox",
|
|
9875
10012
|
checked,
|
|
9876
10013
|
onChange: () => {
|
|
9877
|
-
const
|
|
10014
|
+
const cleaned = arr.filter((x) => x !== "__na__");
|
|
10015
|
+
const next = checked ? cleaned.filter((x) => x !== opt.id) : [...cleaned, opt.id];
|
|
9878
10016
|
setAnswer(q.key, next);
|
|
9879
10017
|
}
|
|
9880
10018
|
}
|
|
@@ -9912,7 +10050,8 @@ const SurveyLivePreviewPane = ({
|
|
|
9912
10050
|
type: "checkbox",
|
|
9913
10051
|
checked,
|
|
9914
10052
|
onChange: () => {
|
|
9915
|
-
const
|
|
10053
|
+
const cleaned = arr.filter((x) => x !== "__na__");
|
|
10054
|
+
const next = checked ? cleaned.filter((x) => x !== "__other__") : [...cleaned, "__other__"];
|
|
9916
10055
|
setAnswer(q.key, next);
|
|
9917
10056
|
}
|
|
9918
10057
|
}
|
|
@@ -9947,6 +10086,39 @@ const SurveyLivePreviewPane = ({
|
|
|
9947
10086
|
}
|
|
9948
10087
|
)
|
|
9949
10088
|
] });
|
|
10089
|
+
})(),
|
|
10090
|
+
q.allowNoOpinion && (() => {
|
|
10091
|
+
const arr = Array.isArray(val) ? val : [];
|
|
10092
|
+
const checked = arr.includes("__na__");
|
|
10093
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10094
|
+
"label",
|
|
10095
|
+
{
|
|
10096
|
+
style: {
|
|
10097
|
+
display: "flex",
|
|
10098
|
+
alignItems: "center",
|
|
10099
|
+
gap: 9,
|
|
10100
|
+
padding: "9px 12px",
|
|
10101
|
+
borderRadius: 8,
|
|
10102
|
+
border: checked ? "1.5px solid #475569" : "1px dashed #94a3b8",
|
|
10103
|
+
background: checked ? "#f1f5f9" : "#ffffff",
|
|
10104
|
+
color: "#334155",
|
|
10105
|
+
fontSize: 13,
|
|
10106
|
+
fontWeight: checked ? 700 : 500,
|
|
10107
|
+
cursor: "pointer"
|
|
10108
|
+
},
|
|
10109
|
+
children: [
|
|
10110
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10111
|
+
"input",
|
|
10112
|
+
{
|
|
10113
|
+
type: "checkbox",
|
|
10114
|
+
checked,
|
|
10115
|
+
onChange: () => setAnswer(q.key, checked ? [] : ["__na__"])
|
|
10116
|
+
}
|
|
10117
|
+
),
|
|
10118
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getNoOpinionLabel(q) })
|
|
10119
|
+
]
|
|
10120
|
+
}
|
|
10121
|
+
);
|
|
9950
10122
|
})()
|
|
9951
10123
|
] }),
|
|
9952
10124
|
q.type === "dropdown" && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
@@ -9971,7 +10143,8 @@ const SurveyLivePreviewPane = ({
|
|
|
9971
10143
|
q.otherLabel,
|
|
9972
10144
|
testLocale,
|
|
9973
10145
|
trTest ? "Diğer" : "Other"
|
|
9974
|
-
) })
|
|
10146
|
+
) }),
|
|
10147
|
+
q.allowNoOpinion && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "__na__", children: getNoOpinionLabel(q) })
|
|
9975
10148
|
]
|
|
9976
10149
|
}
|
|
9977
10150
|
),
|
|
@@ -10015,7 +10188,7 @@ const SurveyLivePreviewPane = ({
|
|
|
10015
10188
|
{
|
|
10016
10189
|
onClick: () => {
|
|
10017
10190
|
if (isMultiImg) {
|
|
10018
|
-
const arr = Array.isArray(val) ? val : [];
|
|
10191
|
+
const arr = Array.isArray(val) ? val.filter((x) => x !== "__na__") : [];
|
|
10019
10192
|
const next = selected ? arr.filter((x) => x !== opt.id) : [...arr, opt.id];
|
|
10020
10193
|
setAnswer(q.key, next);
|
|
10021
10194
|
} else {
|
|
@@ -10179,7 +10352,7 @@ const SurveyLivePreviewPane = ({
|
|
|
10179
10352
|
starVal
|
|
10180
10353
|
);
|
|
10181
10354
|
}),
|
|
10182
|
-
val ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10355
|
+
typeof val === "number" && val > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10183
10356
|
"span",
|
|
10184
10357
|
{
|
|
10185
10358
|
style: {
|
|
@@ -10340,7 +10513,18 @@ const SurveyLivePreviewPane = ({
|
|
|
10340
10513
|
})(),
|
|
10341
10514
|
q.type === "matrix_single" && (() => {
|
|
10342
10515
|
const mRows = Array.isArray(q.matrixRows) ? q.matrixRows : [];
|
|
10343
|
-
const
|
|
10516
|
+
const baseCols = Array.isArray(q.matrixColumns) ? q.matrixColumns : [];
|
|
10517
|
+
const mCols = q.allowNoOpinion ? [
|
|
10518
|
+
...baseCols,
|
|
10519
|
+
{
|
|
10520
|
+
id: "__na__",
|
|
10521
|
+
labels: {
|
|
10522
|
+
tr: getNoOpinionLabel(q),
|
|
10523
|
+
en: getNoOpinionLabel(q),
|
|
10524
|
+
[testLocale]: getNoOpinionLabel(q)
|
|
10525
|
+
}
|
|
10526
|
+
}
|
|
10527
|
+
] : baseCols;
|
|
10344
10528
|
const matrixAns = val && typeof val === "object" && !Array.isArray(val) ? val : {};
|
|
10345
10529
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { overflowX: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10346
10530
|
"table",
|
|
@@ -10548,6 +10732,51 @@ const SurveyLivePreviewPane = ({
|
|
|
10548
10732
|
})
|
|
10549
10733
|
] });
|
|
10550
10734
|
})(),
|
|
10735
|
+
q.allowNoOpinion && ["nps", "star_rating", "likert_scale", "image_choice", "ranking"].includes(
|
|
10736
|
+
q.type
|
|
10737
|
+
) && (() => {
|
|
10738
|
+
const isMulti = q.type === "ranking" || q.type === "image_choice" && (q.maxSelections ?? 1) > 1;
|
|
10739
|
+
const isNoOpSelected = isMulti ? Array.isArray(val) && val.includes("__na__") : val === "__na__";
|
|
10740
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: 10 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10741
|
+
"button",
|
|
10742
|
+
{
|
|
10743
|
+
type: "button",
|
|
10744
|
+
onClick: () => {
|
|
10745
|
+
if (isNoOpSelected) {
|
|
10746
|
+
if (q.type === "ranking") {
|
|
10747
|
+
setAnswer(
|
|
10748
|
+
q.key,
|
|
10749
|
+
(q.options || []).map((o) => o.id)
|
|
10750
|
+
);
|
|
10751
|
+
} else if (isMulti) {
|
|
10752
|
+
setAnswer(q.key, []);
|
|
10753
|
+
} else {
|
|
10754
|
+
setAnswer(q.key, null);
|
|
10755
|
+
}
|
|
10756
|
+
} else {
|
|
10757
|
+
setAnswer(q.key, isMulti ? ["__na__"] : "__na__");
|
|
10758
|
+
}
|
|
10759
|
+
},
|
|
10760
|
+
style: {
|
|
10761
|
+
padding: "6px 13px",
|
|
10762
|
+
borderRadius: 18,
|
|
10763
|
+
border: isNoOpSelected ? "1.5px solid #334155" : "1px dashed #94a3b8",
|
|
10764
|
+
background: isNoOpSelected ? "#334155" : "#f8fafc",
|
|
10765
|
+
color: isNoOpSelected ? "#ffffff" : "#475569",
|
|
10766
|
+
fontSize: 12,
|
|
10767
|
+
fontWeight: 700,
|
|
10768
|
+
cursor: "pointer",
|
|
10769
|
+
display: "inline-flex",
|
|
10770
|
+
alignItems: "center",
|
|
10771
|
+
gap: 6
|
|
10772
|
+
},
|
|
10773
|
+
children: [
|
|
10774
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: isNoOpSelected ? "✓" : "○" }),
|
|
10775
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: getNoOpinionLabel(q) })
|
|
10776
|
+
]
|
|
10777
|
+
}
|
|
10778
|
+
) });
|
|
10779
|
+
})(),
|
|
10551
10780
|
q.type === "short_text" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10552
10781
|
"input",
|
|
10553
10782
|
{
|
|
@@ -12341,22 +12570,25 @@ const labelStyle = {
|
|
|
12341
12570
|
color: "#475569",
|
|
12342
12571
|
marginBottom: 4
|
|
12343
12572
|
};
|
|
12573
|
+
const TURKISH_CHAR_MAP = {
|
|
12574
|
+
ç: "c",
|
|
12575
|
+
Ç: "c",
|
|
12576
|
+
ğ: "g",
|
|
12577
|
+
Ğ: "g",
|
|
12578
|
+
ı: "i",
|
|
12579
|
+
İ: "i",
|
|
12580
|
+
ö: "o",
|
|
12581
|
+
Ö: "o",
|
|
12582
|
+
ş: "s",
|
|
12583
|
+
Ş: "s",
|
|
12584
|
+
ü: "u",
|
|
12585
|
+
Ü: "u"
|
|
12586
|
+
};
|
|
12587
|
+
function sanitizeSlugInput(input) {
|
|
12588
|
+
return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "");
|
|
12589
|
+
}
|
|
12344
12590
|
function slugifyKey(input) {
|
|
12345
|
-
|
|
12346
|
-
ç: "c",
|
|
12347
|
-
Ç: "c",
|
|
12348
|
-
ğ: "g",
|
|
12349
|
-
Ğ: "g",
|
|
12350
|
-
ı: "i",
|
|
12351
|
-
İ: "i",
|
|
12352
|
-
ö: "o",
|
|
12353
|
-
Ö: "o",
|
|
12354
|
-
ş: "s",
|
|
12355
|
-
Ş: "s",
|
|
12356
|
-
ü: "u",
|
|
12357
|
-
Ü: "u"
|
|
12358
|
-
};
|
|
12359
|
-
return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
|
|
12591
|
+
return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
|
|
12360
12592
|
}
|
|
12361
12593
|
const LIKERT_SCALE_PRESETS = [
|
|
12362
12594
|
{
|
|
@@ -12462,13 +12694,14 @@ const QUESTION_TYPES_CATALOG = [
|
|
|
12462
12694
|
function createBlankSurveyDraft(locale = "en") {
|
|
12463
12695
|
const tr = locale === "tr";
|
|
12464
12696
|
const ts = Date.now().toString(36).slice(-4);
|
|
12697
|
+
const initialTitle = tr ? "Yeni Müşteri Geri Bildirim Anketi" : "New Customer Feedback Survey";
|
|
12465
12698
|
return {
|
|
12466
|
-
title:
|
|
12699
|
+
title: initialTitle,
|
|
12467
12700
|
titleI18n: {
|
|
12468
12701
|
en: "New Customer Feedback Survey",
|
|
12469
12702
|
tr: "Yeni Müşteri Geri Bildirim Anketi"
|
|
12470
12703
|
},
|
|
12471
|
-
slug:
|
|
12704
|
+
slug: `${slugifyKey(initialTitle)}-${ts}`,
|
|
12472
12705
|
description: {
|
|
12473
12706
|
tr: "Görüşleriniz hizmet kalitemizi geliştirmemize yardımcı olur.",
|
|
12474
12707
|
en: "Your feedback helps us improve our service quality."
|
|
@@ -12605,6 +12838,9 @@ const SurveyStudioModal = ({
|
|
|
12605
12838
|
const [dropIndicator, setDropIndicator] = React.useState(null);
|
|
12606
12839
|
const [saving, setSaving] = React.useState(false);
|
|
12607
12840
|
const [statusMsg, setStatusMsg] = React.useState("");
|
|
12841
|
+
const [slugAutoSync, setSlugAutoSync] = React.useState(
|
|
12842
|
+
() => !initialSurvey.id && !initialSurvey.documentId && !initialSurvey._id
|
|
12843
|
+
);
|
|
12608
12844
|
const [optDragReadyIdx, setOptDragReadyIdx] = React.useState(null);
|
|
12609
12845
|
const [studioExportOpen, setStudioExportOpen] = React.useState(false);
|
|
12610
12846
|
const [studioImportOpen, setStudioImportOpen] = React.useState(false);
|
|
@@ -12623,6 +12859,7 @@ const SurveyStudioModal = ({
|
|
|
12623
12859
|
const cloned = JSON.parse(JSON.stringify(initialSurvey));
|
|
12624
12860
|
const nextDraft = cloned.displayMode === "multi_step" ? normalizeMultiStepDraft(cloned) : cloned;
|
|
12625
12861
|
setDraft(nextDraft);
|
|
12862
|
+
setSlugAutoSync(!cloned.id && !cloned.documentId && !cloned._id);
|
|
12626
12863
|
setSelectedQuestionIdx(0);
|
|
12627
12864
|
setCollapsedStepIds({});
|
|
12628
12865
|
setOpenStepDescIds({});
|
|
@@ -12694,14 +12931,17 @@ const SurveyStudioModal = ({
|
|
|
12694
12931
|
setSaving(true);
|
|
12695
12932
|
setStatusMsg("");
|
|
12696
12933
|
try {
|
|
12934
|
+
const cleanFinalSlug = slugifyKey(draft.slug) || slugifyKey(draft.title) || `survey-${Date.now().toString(36).slice(-4)}`;
|
|
12697
12935
|
const payload = {
|
|
12698
12936
|
...draft,
|
|
12937
|
+
slug: cleanFinalSlug,
|
|
12699
12938
|
id: draft.documentId || draft._id || draft.id
|
|
12700
12939
|
};
|
|
12701
12940
|
const res = await post("/content-input/surveys", payload);
|
|
12702
12941
|
const saved = res?.data;
|
|
12703
12942
|
if (saved) {
|
|
12704
12943
|
setDraft(JSON.parse(JSON.stringify(saved)));
|
|
12944
|
+
setSlugAutoSync(false);
|
|
12705
12945
|
setStatusMsg(tr ? "Anket kaydedildi!" : "Survey saved!");
|
|
12706
12946
|
if (typeof window !== "undefined") {
|
|
12707
12947
|
window.dispatchEvent(new CustomEvent("ci-survey-updated", { detail: saved }));
|
|
@@ -12782,27 +13022,35 @@ const SurveyStudioModal = ({
|
|
|
12782
13022
|
children: [
|
|
12783
13023
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
|
|
12784
13024
|
/* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "poll", size: 22, color: "#38bdf8" }),
|
|
12785
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12786
|
-
|
|
12787
|
-
|
|
12788
|
-
|
|
12789
|
-
" ",
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
13025
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
13026
|
+
"div",
|
|
13027
|
+
{
|
|
13028
|
+
onClick: () => setTab("settings"),
|
|
13029
|
+
title: tr ? "Yönetim başlığını ve Survey Slug alanını düzenlemek için tıklayın" : "Click to edit Internal Title & Survey Slug",
|
|
13030
|
+
style: { cursor: "pointer" },
|
|
13031
|
+
children: [
|
|
13032
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 15, fontWeight: 700 }, children: [
|
|
13033
|
+
tr ? "Kurumsal Anket & Oylama Stüdyosu" : "Enterprise Survey & Poll Studio",
|
|
13034
|
+
" —",
|
|
13035
|
+
" ",
|
|
13036
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#93c5fd", textDecoration: "underline dotted" }, children: draft.title })
|
|
13037
|
+
] }),
|
|
13038
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, color: "#94a3b8" }, children: [
|
|
13039
|
+
"Slug: ",
|
|
13040
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: draft.slug }),
|
|
13041
|
+
" • Mode: ",
|
|
13042
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: draft.displayMode }),
|
|
13043
|
+
" • Submit:",
|
|
13044
|
+
" ",
|
|
13045
|
+
/* @__PURE__ */ jsxRuntime.jsxs("code", { children: [
|
|
13046
|
+
"/api/content-input/surveys/",
|
|
13047
|
+
draft.slug,
|
|
13048
|
+
"/submit"
|
|
13049
|
+
] })
|
|
13050
|
+
] })
|
|
13051
|
+
]
|
|
13052
|
+
}
|
|
13053
|
+
)
|
|
12806
13054
|
] }),
|
|
12807
13055
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
12808
13056
|
statusMsg && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14536,7 +14784,10 @@ const SurveyStudioModal = ({
|
|
|
14536
14784
|
type: "text",
|
|
14537
14785
|
value: activeQ.key,
|
|
14538
14786
|
onChange: (e) => updateActiveQuestion({
|
|
14539
|
-
key:
|
|
14787
|
+
key: sanitizeSlugInput(e.target.value)
|
|
14788
|
+
}),
|
|
14789
|
+
onBlur: (e) => updateActiveQuestion({
|
|
14790
|
+
key: slugifyKey(e.target.value) || `q_${activeQ.type}_${selectedQuestionIdx + 1}`
|
|
14540
14791
|
}),
|
|
14541
14792
|
style: { ...inputStyle, fontFamily: "monospace" }
|
|
14542
14793
|
}
|
|
@@ -14649,6 +14900,121 @@ const SurveyStudioModal = ({
|
|
|
14649
14900
|
)
|
|
14650
14901
|
] });
|
|
14651
14902
|
})(),
|
|
14903
|
+
[
|
|
14904
|
+
"single_choice",
|
|
14905
|
+
"multiple_choice",
|
|
14906
|
+
"dropdown",
|
|
14907
|
+
"image_choice",
|
|
14908
|
+
"nps",
|
|
14909
|
+
"star_rating",
|
|
14910
|
+
"likert_scale",
|
|
14911
|
+
"matrix_single",
|
|
14912
|
+
"ranking"
|
|
14913
|
+
].includes(activeQ.type) && (() => {
|
|
14914
|
+
const noOpObj = normalizeLocalizedRecord(
|
|
14915
|
+
activeQ.noOpinionLabel,
|
|
14916
|
+
strapiLocales,
|
|
14917
|
+
{
|
|
14918
|
+
tr: "Fikrim yok",
|
|
14919
|
+
en: "No idea"
|
|
14920
|
+
}
|
|
14921
|
+
);
|
|
14922
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14923
|
+
"div",
|
|
14924
|
+
{
|
|
14925
|
+
style: {
|
|
14926
|
+
padding: "10px 12px",
|
|
14927
|
+
borderRadius: 8,
|
|
14928
|
+
background: activeQ.allowNoOpinion ? "#f0fdf4" : "#f8fafc",
|
|
14929
|
+
border: activeQ.allowNoOpinion ? "1px solid #86efac" : "1px solid #e2e8f0",
|
|
14930
|
+
display: "flex",
|
|
14931
|
+
flexDirection: "column",
|
|
14932
|
+
gap: 8
|
|
14933
|
+
},
|
|
14934
|
+
children: [
|
|
14935
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14936
|
+
"div",
|
|
14937
|
+
{
|
|
14938
|
+
style: {
|
|
14939
|
+
display: "flex",
|
|
14940
|
+
alignItems: "center",
|
|
14941
|
+
justifyContent: "space-between",
|
|
14942
|
+
flexWrap: "wrap",
|
|
14943
|
+
gap: 8
|
|
14944
|
+
},
|
|
14945
|
+
children: [
|
|
14946
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
14947
|
+
"label",
|
|
14948
|
+
{
|
|
14949
|
+
style: {
|
|
14950
|
+
display: "inline-flex",
|
|
14951
|
+
alignItems: "center",
|
|
14952
|
+
gap: 7,
|
|
14953
|
+
fontSize: 11.5,
|
|
14954
|
+
fontWeight: 700,
|
|
14955
|
+
color: "#0f172a",
|
|
14956
|
+
cursor: "pointer"
|
|
14957
|
+
},
|
|
14958
|
+
children: [
|
|
14959
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14960
|
+
"input",
|
|
14961
|
+
{
|
|
14962
|
+
type: "checkbox",
|
|
14963
|
+
checked: Boolean(activeQ.allowNoOpinion),
|
|
14964
|
+
onChange: (e) => {
|
|
14965
|
+
const enabled = e.target.checked;
|
|
14966
|
+
updateActiveQuestion({
|
|
14967
|
+
allowNoOpinion: enabled,
|
|
14968
|
+
...enabled && !activeQ.noOpinionLabel ? { noOpinionLabel: noOpObj } : {}
|
|
14969
|
+
});
|
|
14970
|
+
}
|
|
14971
|
+
}
|
|
14972
|
+
),
|
|
14973
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: tr ? '"Fikrim yok / Bilmiyorum" (No idea / N/A) Seçeneği Sun' : 'Allow "No idea / N/A" (No Opinion) Option' })
|
|
14974
|
+
]
|
|
14975
|
+
}
|
|
14976
|
+
),
|
|
14977
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 10.5, color: "#64748b" }, children: tr ? "Zorunlu soruyu geçer; ölçek/puan ortalamasını ve NPS skorunu bozmaz" : "Satisfies required rule without skewing score averages or NPS" })
|
|
14978
|
+
]
|
|
14979
|
+
}
|
|
14980
|
+
),
|
|
14981
|
+
activeQ.allowNoOpinion && /* @__PURE__ */ jsxRuntime.jsx(
|
|
14982
|
+
"div",
|
|
14983
|
+
{
|
|
14984
|
+
style: {
|
|
14985
|
+
display: "grid",
|
|
14986
|
+
gridTemplateColumns: localeGridCols,
|
|
14987
|
+
gap: 8
|
|
14988
|
+
},
|
|
14989
|
+
children: strapiLocales.map((loc) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
14990
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: labelStyle, children: [
|
|
14991
|
+
tr ? "Boş / Fikrim Yok Etiketi" : "No-Opinion Label",
|
|
14992
|
+
" (",
|
|
14993
|
+
loc.code.toUpperCase(),
|
|
14994
|
+
")"
|
|
14995
|
+
] }),
|
|
14996
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
14997
|
+
"input",
|
|
14998
|
+
{
|
|
14999
|
+
type: "text",
|
|
15000
|
+
value: noOpObj[loc.code] || "",
|
|
15001
|
+
onChange: (e) => updateActiveQuestion({
|
|
15002
|
+
noOpinionLabel: {
|
|
15003
|
+
...noOpObj,
|
|
15004
|
+
[loc.code]: e.target.value
|
|
15005
|
+
}
|
|
15006
|
+
}),
|
|
15007
|
+
placeholder: loc.code.toLowerCase().startsWith("tr") ? "Fikrim yok" : "No idea",
|
|
15008
|
+
style: inputStyle
|
|
15009
|
+
}
|
|
15010
|
+
)
|
|
15011
|
+
] }, `noop-${loc.code}`))
|
|
15012
|
+
}
|
|
15013
|
+
)
|
|
15014
|
+
]
|
|
15015
|
+
}
|
|
15016
|
+
);
|
|
15017
|
+
})(),
|
|
14652
15018
|
[
|
|
14653
15019
|
"single_choice",
|
|
14654
15020
|
"multiple_choice",
|
|
@@ -14836,7 +15202,16 @@ const SurveyStudioModal = ({
|
|
|
14836
15202
|
value: opt.id,
|
|
14837
15203
|
onChange: (e) => {
|
|
14838
15204
|
const next = opts.map(
|
|
14839
|
-
(x, i) => i === oIdx ? { ...x, id:
|
|
15205
|
+
(x, i) => i === oIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
|
|
15206
|
+
);
|
|
15207
|
+
saveOpts(next);
|
|
15208
|
+
},
|
|
15209
|
+
onBlur: (e) => {
|
|
15210
|
+
const next = opts.map(
|
|
15211
|
+
(x, i) => i === oIdx ? {
|
|
15212
|
+
...x,
|
|
15213
|
+
id: slugifyKey(e.target.value) || `opt_${oIdx + 1}`
|
|
15214
|
+
} : x
|
|
14840
15215
|
);
|
|
14841
15216
|
saveOpts(next);
|
|
14842
15217
|
},
|
|
@@ -14904,7 +15279,7 @@ const SurveyStudioModal = ({
|
|
|
14904
15279
|
) })
|
|
14905
15280
|
]
|
|
14906
15281
|
},
|
|
14907
|
-
|
|
15282
|
+
oIdx
|
|
14908
15283
|
);
|
|
14909
15284
|
}),
|
|
14910
15285
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15408,7 +15783,16 @@ const SurveyStudioModal = ({
|
|
|
15408
15783
|
value: r.id,
|
|
15409
15784
|
onChange: (e) => {
|
|
15410
15785
|
const next = mRows.map(
|
|
15411
|
-
(x, i) => i === rIdx ? { ...x, id:
|
|
15786
|
+
(x, i) => i === rIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
|
|
15787
|
+
);
|
|
15788
|
+
updateActiveQuestion({ matrixRows: next });
|
|
15789
|
+
},
|
|
15790
|
+
onBlur: (e) => {
|
|
15791
|
+
const next = mRows.map(
|
|
15792
|
+
(x, i) => i === rIdx ? {
|
|
15793
|
+
...x,
|
|
15794
|
+
id: slugifyKey(e.target.value) || `row_${rIdx + 1}`
|
|
15795
|
+
} : x
|
|
15412
15796
|
);
|
|
15413
15797
|
updateActiveQuestion({ matrixRows: next });
|
|
15414
15798
|
},
|
|
@@ -15451,7 +15835,7 @@ const SurveyStudioModal = ({
|
|
|
15451
15835
|
)
|
|
15452
15836
|
]
|
|
15453
15837
|
},
|
|
15454
|
-
|
|
15838
|
+
rIdx
|
|
15455
15839
|
);
|
|
15456
15840
|
})
|
|
15457
15841
|
] }),
|
|
@@ -15519,7 +15903,16 @@ const SurveyStudioModal = ({
|
|
|
15519
15903
|
value: c.id,
|
|
15520
15904
|
onChange: (e) => {
|
|
15521
15905
|
const next = mCols.map(
|
|
15522
|
-
(x, i) => i === cIdx ? { ...x, id:
|
|
15906
|
+
(x, i) => i === cIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
|
|
15907
|
+
);
|
|
15908
|
+
updateActiveQuestion({ matrixColumns: next });
|
|
15909
|
+
},
|
|
15910
|
+
onBlur: (e) => {
|
|
15911
|
+
const next = mCols.map(
|
|
15912
|
+
(x, i) => i === cIdx ? {
|
|
15913
|
+
...x,
|
|
15914
|
+
id: slugifyKey(e.target.value) || `col_${cIdx + 1}`
|
|
15915
|
+
} : x
|
|
15523
15916
|
);
|
|
15524
15917
|
updateActiveQuestion({ matrixColumns: next });
|
|
15525
15918
|
},
|
|
@@ -15562,7 +15955,7 @@ const SurveyStudioModal = ({
|
|
|
15562
15955
|
)
|
|
15563
15956
|
]
|
|
15564
15957
|
},
|
|
15565
|
-
|
|
15958
|
+
cIdx
|
|
15566
15959
|
);
|
|
15567
15960
|
})
|
|
15568
15961
|
] })
|
|
@@ -15786,25 +16179,102 @@ const SurveyStudioModal = ({
|
|
|
15786
16179
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 13, fontWeight: 700, color: "#0f172a" }, children: tr ? "Anket Kimliği & Çok Dilli Başlıklar" : "Survey Identity & Localized Titles" }),
|
|
15787
16180
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 10 }, children: [
|
|
15788
16181
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
15789
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle, children: tr ? "Yönetim Başlığı" : "Internal Title" }),
|
|
16182
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle, children: tr ? "Yönetim Başlığı (Internal Title)" : "Survey Internal Title" }),
|
|
15790
16183
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15791
16184
|
"input",
|
|
15792
16185
|
{
|
|
15793
16186
|
type: "text",
|
|
15794
16187
|
value: draft.title,
|
|
15795
|
-
onChange: (e) =>
|
|
16188
|
+
onChange: (e) => {
|
|
16189
|
+
const nextTitle = e.target.value;
|
|
16190
|
+
setDraft((prev) => ({
|
|
16191
|
+
...prev,
|
|
16192
|
+
title: nextTitle,
|
|
16193
|
+
...slugAutoSync ? { slug: slugifyKey(nextTitle) } : {}
|
|
16194
|
+
}));
|
|
16195
|
+
},
|
|
16196
|
+
placeholder: tr ? "Örn: 2026 Müşteri Nabzı Anketi" : "e.g. 2026 Customer Pulse Survey",
|
|
15796
16197
|
style: inputStyle
|
|
15797
16198
|
}
|
|
15798
16199
|
)
|
|
15799
16200
|
] }),
|
|
15800
16201
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
15801
|
-
/* @__PURE__ */ jsxRuntime.
|
|
16202
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16203
|
+
"div",
|
|
16204
|
+
{
|
|
16205
|
+
style: {
|
|
16206
|
+
display: "flex",
|
|
16207
|
+
alignItems: "center",
|
|
16208
|
+
justifyContent: "space-between",
|
|
16209
|
+
gap: 6,
|
|
16210
|
+
marginBottom: 4
|
|
16211
|
+
},
|
|
16212
|
+
children: [
|
|
16213
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { style: { ...labelStyle, marginBottom: 0 }, children: [
|
|
16214
|
+
"Survey Slug",
|
|
16215
|
+
" ",
|
|
16216
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16217
|
+
"span",
|
|
16218
|
+
{
|
|
16219
|
+
style: {
|
|
16220
|
+
fontSize: 9.5,
|
|
16221
|
+
fontWeight: 700,
|
|
16222
|
+
padding: "1px 6px",
|
|
16223
|
+
borderRadius: 8,
|
|
16224
|
+
marginLeft: 4,
|
|
16225
|
+
background: slugAutoSync ? "#dbeafe" : "#f1f5f9",
|
|
16226
|
+
color: slugAutoSync ? "#1e40af" : "#475569"
|
|
16227
|
+
},
|
|
16228
|
+
children: slugAutoSync ? tr ? "Otomatik" : "Auto" : tr ? "Özel" : "Custom"
|
|
16229
|
+
}
|
|
16230
|
+
)
|
|
16231
|
+
] }),
|
|
16232
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
16233
|
+
"button",
|
|
16234
|
+
{
|
|
16235
|
+
type: "button",
|
|
16236
|
+
onClick: () => {
|
|
16237
|
+
const generated = slugifyKey(draft.title);
|
|
16238
|
+
setDraft((prev) => ({
|
|
16239
|
+
...prev,
|
|
16240
|
+
slug: generated || prev.slug
|
|
16241
|
+
}));
|
|
16242
|
+
setSlugAutoSync(true);
|
|
16243
|
+
},
|
|
16244
|
+
title: tr ? "Yönetim Başlığından (Internal Title) otomatik slug üret ve senkronla" : "Generate slug from Internal Title and keep synced",
|
|
16245
|
+
style: {
|
|
16246
|
+
padding: "1px 7px",
|
|
16247
|
+
borderRadius: 5,
|
|
16248
|
+
border: "1px solid #93c5fd",
|
|
16249
|
+
background: "#eff6ff",
|
|
16250
|
+
color: "#1d4ed8",
|
|
16251
|
+
fontSize: 10,
|
|
16252
|
+
fontWeight: 700,
|
|
16253
|
+
cursor: "pointer"
|
|
16254
|
+
},
|
|
16255
|
+
children: tr ? "↻ Başlıktan Üret" : "↻ From Title"
|
|
16256
|
+
}
|
|
16257
|
+
)
|
|
16258
|
+
]
|
|
16259
|
+
}
|
|
16260
|
+
),
|
|
15802
16261
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15803
16262
|
"input",
|
|
15804
16263
|
{
|
|
15805
16264
|
type: "text",
|
|
15806
16265
|
value: draft.slug,
|
|
15807
|
-
onChange: (e) =>
|
|
16266
|
+
onChange: (e) => {
|
|
16267
|
+
setSlugAutoSync(false);
|
|
16268
|
+
setDraft((prev) => ({
|
|
16269
|
+
...prev,
|
|
16270
|
+
slug: sanitizeSlugInput(e.target.value)
|
|
16271
|
+
}));
|
|
16272
|
+
},
|
|
16273
|
+
onBlur: (e) => {
|
|
16274
|
+
const cleaned = slugifyKey(e.target.value) || slugifyKey(draft.title) || `survey-${Date.now().toString(36).slice(-4)}`;
|
|
16275
|
+
setDraft((prev) => ({ ...prev, slug: cleaned }));
|
|
16276
|
+
},
|
|
16277
|
+
placeholder: "ornek-anket_2026",
|
|
15808
16278
|
style: { ...inputStyle, fontFamily: "monospace" }
|
|
15809
16279
|
}
|
|
15810
16280
|
)
|