@ozguraltan/strapi-content-input 1.0.24 → 1.0.25

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.
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const admin = require("@strapi/strapi/admin");
6
6
  const XLSXNs = require("xlsx");
7
- const index = require("./index-CHtB_Fa5.js");
8
- const SurveyWidgetEditor = require("./SurveyWidgetEditor-D3KiAotu.js");
7
+ const index = require("./index--fSIDKkt.js");
8
+ const SurveyWidgetEditor = require("./SurveyWidgetEditor-DNDtKbmo.js");
9
9
  function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
11
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -2,8 +2,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState, useCallback, useEffect } from "react";
3
3
  import { useFetchClient } from "@strapi/strapi/admin";
4
4
  import * as XLSXNs from "xlsx";
5
- import { M as MaterialIcon } from "./index-C5Uj5YV9.mjs";
6
- import { h as useStrapiLocales, K as getInitialLocale, L as createBlankSurveyDraft, M as ColorCodesManager, N as pickTextForLocale, O as SurveyAnalyticsView, P as SurveyStudioModal, Q as SurveyExportModal, T as SurveyImportModal, U as SurveyCleanupConfirmModal, V as persistLocale } from "./SurveyWidgetEditor-Y5BR-NWE.mjs";
5
+ import { M as MaterialIcon } from "./index-BdrFmPg5.mjs";
6
+ import { h as useStrapiLocales, K as getInitialLocale, L as createBlankSurveyDraft, M as ColorCodesManager, N as pickTextForLocale, O as SurveyAnalyticsView, P as SurveyStudioModal, Q as SurveyExportModal, T as SurveyImportModal, U as SurveyCleanupConfirmModal, V as persistLocale } from "./SurveyWidgetEditor-DdZBpfbS.mjs";
7
7
  const XLSX = XLSXNs?.utils ? XLSXNs : XLSXNs?.default || XLSXNs;
8
8
  const AnalyticsHubPage = () => {
9
9
  const { get, post } = useFetchClient();
@@ -1,8 +1,8 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
3
3
  import { createPortal } from "react-dom";
4
- import { u as uid, a as useEditorTranslator, R as ROW_PRESETS, g as getRowPresetLabel, W as WIDGET_DEFINITIONS, b as getWidgetLabel, C as CIColorField, c as createWidget, d as createBlock, e as createRow, f as getWidgetDefinition, S as StrapiMediaPicker, D as DEVICES, r as resolveAdminMediaUrl, h as useStrapiLocales, i as useOptionalEditorContext, j as resolveCanvasMediaUrl, k as DEVICE_INDEX_MAP, l as useEditorContext, m as getDevice, n as rowCanvasClasses, o as nodeCanvasStyles, p as extractResponsiveProp, q as blockCanvasClasses, s as useColorCodes, t as getDeviceLabel, v as WIDTH_PRESETS, Z as ZOOM_OPTIONS, w as ColorCodesModal, x as getWidgetDescription, y as WIDGET_CATEGORIES, z as normalizeLocalizedRecord, A as normalizeOptionListByLocales, B as getDeviceTooltip, E as SurveyWidgetEditor, F as setResponsiveProp, G as getClipboard, H as copyToClipboard, I as EditorProvider, J as ensureIds } from "./SurveyWidgetEditor-Y5BR-NWE.mjs";
5
- import { M as MaterialIcon } from "./index-C5Uj5YV9.mjs";
4
+ import { u as uid, a as useEditorTranslator, R as ROW_PRESETS, g as getRowPresetLabel, W as WIDGET_DEFINITIONS, b as getWidgetLabel, C as CIColorField, c as createWidget, d as createBlock, e as createRow, f as getWidgetDefinition, S as StrapiMediaPicker, D as DEVICES, r as resolveAdminMediaUrl, h as useStrapiLocales, i as useOptionalEditorContext, j as resolveCanvasMediaUrl, k as DEVICE_INDEX_MAP, l as useEditorContext, m as getDevice, n as rowCanvasClasses, o as nodeCanvasStyles, p as extractResponsiveProp, q as blockCanvasClasses, s as useColorCodes, t as getDeviceLabel, v as WIDTH_PRESETS, Z as ZOOM_OPTIONS, w as ColorCodesModal, x as getWidgetDescription, y as WIDGET_CATEGORIES, z as normalizeLocalizedRecord, A as normalizeOptionListByLocales, B as getDeviceTooltip, E as SurveyWidgetEditor, F as setResponsiveProp, G as getClipboard, H as copyToClipboard, I as EditorProvider, J as ensureIds } from "./SurveyWidgetEditor-DdZBpfbS.mjs";
5
+ import { M as MaterialIcon } from "./index-BdrFmPg5.mjs";
6
6
  import { Swiper, SwiperSlide } from "swiper/react";
7
7
  import { Navigation, Pagination, Autoplay, Parallax, EffectFade, EffectCreative, EffectCoverflow, EffectCube, EffectFlip, Mousewheel } from "swiper/modules";
8
8
  import { useFetchClient, useStrapiApp } from "@strapi/strapi/admin";
@@ -21830,22 +21830,25 @@ function ensureLocalizedObj(val, fallbackTr = "", fallbackEn = "") {
21830
21830
  en: String(val.en ?? val.tr ?? fallbackEn ?? fallbackTr)
21831
21831
  };
21832
21832
  }
21833
+ const FORM_TURKISH_CHAR_MAP = {
21834
+ ç: "c",
21835
+ Ç: "c",
21836
+ ğ: "g",
21837
+ Ğ: "g",
21838
+ ı: "i",
21839
+ İ: "i",
21840
+ ö: "o",
21841
+ Ö: "o",
21842
+ ş: "s",
21843
+ Ş: "s",
21844
+ ü: "u",
21845
+ Ü: "u"
21846
+ };
21847
+ function sanitizeFormSlugInput(input) {
21848
+ return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => FORM_TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "");
21849
+ }
21833
21850
  function slugifyFieldKey(input) {
21834
- const map = {
21835
- ç: "c",
21836
- Ç: "c",
21837
- ğ: "g",
21838
- Ğ: "g",
21839
- ı: "i",
21840
- İ: "i",
21841
- ö: "o",
21842
- Ö: "o",
21843
- ş: "s",
21844
- Ş: "s",
21845
- ü: "u",
21846
- Ü: "u"
21847
- };
21848
- return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
21851
+ return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => FORM_TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
21849
21852
  }
21850
21853
  const FIELD_TYPES = [
21851
21854
  { value: "input", labelTr: "Metin Kutusu (Text Input)", labelEn: "Text Input" },
@@ -24734,13 +24737,55 @@ const ContentFormWidgetEditor = ({
24734
24737
  )
24735
24738
  ] }),
24736
24739
  /* @__PURE__ */ jsxs("div", { children: [
24737
- /* @__PURE__ */ jsx("label", { style: labelStyle$1, children: "Form Slug / ID" }),
24740
+ /* @__PURE__ */ jsxs(
24741
+ "div",
24742
+ {
24743
+ style: {
24744
+ display: "flex",
24745
+ alignItems: "center",
24746
+ justifyContent: "space-between",
24747
+ gap: 6,
24748
+ marginBottom: 4
24749
+ },
24750
+ children: [
24751
+ /* @__PURE__ */ jsx("label", { style: { ...labelStyle$1, marginBottom: 0 }, children: "Form Slug / ID" }),
24752
+ /* @__PURE__ */ jsx(
24753
+ "button",
24754
+ {
24755
+ type: "button",
24756
+ onClick: () => setDraft({
24757
+ ...draft,
24758
+ slug: slugifyFieldKey(draft.title || "") || draft.slug
24759
+ }),
24760
+ style: {
24761
+ padding: "1px 7px",
24762
+ borderRadius: 5,
24763
+ border: "1px solid #93c5fd",
24764
+ background: "#eff6ff",
24765
+ color: "#1d4ed8",
24766
+ fontSize: 10,
24767
+ fontWeight: 700,
24768
+ cursor: "pointer"
24769
+ },
24770
+ children: tr ? "↻ Başlıktan Üret" : "↻ From Title"
24771
+ }
24772
+ )
24773
+ ]
24774
+ }
24775
+ ),
24738
24776
  /* @__PURE__ */ jsx(
24739
24777
  "input",
24740
24778
  {
24741
24779
  type: "text",
24742
24780
  value: draft.slug || "",
24743
- onChange: (e) => setDraft({ ...draft, slug: slugifyFieldKey(e.target.value) }),
24781
+ onChange: (e) => setDraft({
24782
+ ...draft,
24783
+ slug: sanitizeFormSlugInput(e.target.value)
24784
+ }),
24785
+ onBlur: (e) => setDraft({
24786
+ ...draft,
24787
+ slug: slugifyFieldKey(e.target.value) || slugifyFieldKey(draft.title || "") || draft.slug
24788
+ }),
24744
24789
  style: { ...inputStyle$1, fontFamily: "monospace" }
24745
24790
  }
24746
24791
  )
@@ -3,8 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const ReactDOM = require("react-dom");
6
- const SurveyWidgetEditor = require("./SurveyWidgetEditor-D3KiAotu.js");
7
- const index = require("./index-CHtB_Fa5.js");
6
+ const SurveyWidgetEditor = require("./SurveyWidgetEditor-DNDtKbmo.js");
7
+ const index = require("./index--fSIDKkt.js");
8
8
  const react = require("swiper/react");
9
9
  const modules = require("swiper/modules");
10
10
  const admin = require("@strapi/strapi/admin");
@@ -21852,22 +21852,25 @@ function ensureLocalizedObj(val, fallbackTr = "", fallbackEn = "") {
21852
21852
  en: String(val.en ?? val.tr ?? fallbackEn ?? fallbackTr)
21853
21853
  };
21854
21854
  }
21855
+ const FORM_TURKISH_CHAR_MAP = {
21856
+ ç: "c",
21857
+ Ç: "c",
21858
+ ğ: "g",
21859
+ Ğ: "g",
21860
+ ı: "i",
21861
+ İ: "i",
21862
+ ö: "o",
21863
+ Ö: "o",
21864
+ ş: "s",
21865
+ Ş: "s",
21866
+ ü: "u",
21867
+ Ü: "u"
21868
+ };
21869
+ function sanitizeFormSlugInput(input) {
21870
+ return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => FORM_TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "");
21871
+ }
21855
21872
  function slugifyFieldKey(input) {
21856
- const map = {
21857
- ç: "c",
21858
- Ç: "c",
21859
- ğ: "g",
21860
- Ğ: "g",
21861
- ı: "i",
21862
- İ: "i",
21863
- ö: "o",
21864
- Ö: "o",
21865
- ş: "s",
21866
- Ş: "s",
21867
- ü: "u",
21868
- Ü: "u"
21869
- };
21870
- return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
21873
+ return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => FORM_TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
21871
21874
  }
21872
21875
  const FIELD_TYPES = [
21873
21876
  { value: "input", labelTr: "Metin Kutusu (Text Input)", labelEn: "Text Input" },
@@ -24756,13 +24759,55 @@ const ContentFormWidgetEditor = ({
24756
24759
  )
24757
24760
  ] }),
24758
24761
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
24759
- /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle$1, children: "Form Slug / ID" }),
24762
+ /* @__PURE__ */ jsxRuntime.jsxs(
24763
+ "div",
24764
+ {
24765
+ style: {
24766
+ display: "flex",
24767
+ alignItems: "center",
24768
+ justifyContent: "space-between",
24769
+ gap: 6,
24770
+ marginBottom: 4
24771
+ },
24772
+ children: [
24773
+ /* @__PURE__ */ jsxRuntime.jsx("label", { style: { ...labelStyle$1, marginBottom: 0 }, children: "Form Slug / ID" }),
24774
+ /* @__PURE__ */ jsxRuntime.jsx(
24775
+ "button",
24776
+ {
24777
+ type: "button",
24778
+ onClick: () => setDraft({
24779
+ ...draft,
24780
+ slug: slugifyFieldKey(draft.title || "") || draft.slug
24781
+ }),
24782
+ style: {
24783
+ padding: "1px 7px",
24784
+ borderRadius: 5,
24785
+ border: "1px solid #93c5fd",
24786
+ background: "#eff6ff",
24787
+ color: "#1d4ed8",
24788
+ fontSize: 10,
24789
+ fontWeight: 700,
24790
+ cursor: "pointer"
24791
+ },
24792
+ children: tr ? "↻ Başlıktan Üret" : "↻ From Title"
24793
+ }
24794
+ )
24795
+ ]
24796
+ }
24797
+ ),
24760
24798
  /* @__PURE__ */ jsxRuntime.jsx(
24761
24799
  "input",
24762
24800
  {
24763
24801
  type: "text",
24764
24802
  value: draft.slug || "",
24765
- onChange: (e) => setDraft({ ...draft, slug: slugifyFieldKey(e.target.value) }),
24803
+ onChange: (e) => setDraft({
24804
+ ...draft,
24805
+ slug: sanitizeFormSlugInput(e.target.value)
24806
+ }),
24807
+ onBlur: (e) => setDraft({
24808
+ ...draft,
24809
+ slug: slugifyFieldKey(e.target.value) || slugifyFieldKey(draft.title || "") || draft.slug
24810
+ }),
24766
24811
  style: { ...inputStyle$1, fontFamily: "monospace" }
24767
24812
  }
24768
24813
  )
@@ -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-CHtB_Fa5.js");
6
+ const index = require("./index--fSIDKkt.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);
@@ -12341,22 +12341,25 @@ const labelStyle = {
12341
12341
  color: "#475569",
12342
12342
  marginBottom: 4
12343
12343
  };
12344
+ const TURKISH_CHAR_MAP = {
12345
+ ç: "c",
12346
+ Ç: "c",
12347
+ ğ: "g",
12348
+ Ğ: "g",
12349
+ ı: "i",
12350
+ İ: "i",
12351
+ ö: "o",
12352
+ Ö: "o",
12353
+ ş: "s",
12354
+ Ş: "s",
12355
+ ü: "u",
12356
+ Ü: "u"
12357
+ };
12358
+ function sanitizeSlugInput(input) {
12359
+ return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "");
12360
+ }
12344
12361
  function slugifyKey(input) {
12345
- const map = {
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, "");
12362
+ 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
12363
  }
12361
12364
  const LIKERT_SCALE_PRESETS = [
12362
12365
  {
@@ -12462,13 +12465,14 @@ const QUESTION_TYPES_CATALOG = [
12462
12465
  function createBlankSurveyDraft(locale = "en") {
12463
12466
  const tr = locale === "tr";
12464
12467
  const ts = Date.now().toString(36).slice(-4);
12468
+ const initialTitle = tr ? "Yeni Müşteri Geri Bildirim Anketi" : "New Customer Feedback Survey";
12465
12469
  return {
12466
- title: tr ? "Yeni Müşteri Geri Bildirim Anketi" : "New Customer Feedback Survey",
12470
+ title: initialTitle,
12467
12471
  titleI18n: {
12468
12472
  en: "New Customer Feedback Survey",
12469
12473
  tr: "Yeni Müşteri Geri Bildirim Anketi"
12470
12474
  },
12471
- slug: `survey_${ts}`,
12475
+ slug: `${slugifyKey(initialTitle)}-${ts}`,
12472
12476
  description: {
12473
12477
  tr: "Görüşleriniz hizmet kalitemizi geliştirmemize yardımcı olur.",
12474
12478
  en: "Your feedback helps us improve our service quality."
@@ -12605,6 +12609,9 @@ const SurveyStudioModal = ({
12605
12609
  const [dropIndicator, setDropIndicator] = React.useState(null);
12606
12610
  const [saving, setSaving] = React.useState(false);
12607
12611
  const [statusMsg, setStatusMsg] = React.useState("");
12612
+ const [slugAutoSync, setSlugAutoSync] = React.useState(
12613
+ () => !initialSurvey.id && !initialSurvey.documentId && !initialSurvey._id
12614
+ );
12608
12615
  const [optDragReadyIdx, setOptDragReadyIdx] = React.useState(null);
12609
12616
  const [studioExportOpen, setStudioExportOpen] = React.useState(false);
12610
12617
  const [studioImportOpen, setStudioImportOpen] = React.useState(false);
@@ -12623,6 +12630,7 @@ const SurveyStudioModal = ({
12623
12630
  const cloned = JSON.parse(JSON.stringify(initialSurvey));
12624
12631
  const nextDraft = cloned.displayMode === "multi_step" ? normalizeMultiStepDraft(cloned) : cloned;
12625
12632
  setDraft(nextDraft);
12633
+ setSlugAutoSync(!cloned.id && !cloned.documentId && !cloned._id);
12626
12634
  setSelectedQuestionIdx(0);
12627
12635
  setCollapsedStepIds({});
12628
12636
  setOpenStepDescIds({});
@@ -12694,14 +12702,17 @@ const SurveyStudioModal = ({
12694
12702
  setSaving(true);
12695
12703
  setStatusMsg("");
12696
12704
  try {
12705
+ const cleanFinalSlug = slugifyKey(draft.slug) || slugifyKey(draft.title) || `survey-${Date.now().toString(36).slice(-4)}`;
12697
12706
  const payload = {
12698
12707
  ...draft,
12708
+ slug: cleanFinalSlug,
12699
12709
  id: draft.documentId || draft._id || draft.id
12700
12710
  };
12701
12711
  const res = await post("/content-input/surveys", payload);
12702
12712
  const saved = res?.data;
12703
12713
  if (saved) {
12704
12714
  setDraft(JSON.parse(JSON.stringify(saved)));
12715
+ setSlugAutoSync(false);
12705
12716
  setStatusMsg(tr ? "Anket kaydedildi!" : "Survey saved!");
12706
12717
  if (typeof window !== "undefined") {
12707
12718
  window.dispatchEvent(new CustomEvent("ci-survey-updated", { detail: saved }));
@@ -12782,27 +12793,35 @@ const SurveyStudioModal = ({
12782
12793
  children: [
12783
12794
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
12784
12795
  /* @__PURE__ */ jsxRuntime.jsx(index.MaterialIcon, { name: "poll", size: 22, color: "#38bdf8" }),
12785
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
12786
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 15, fontWeight: 700 }, children: [
12787
- tr ? "Kurumsal Anket & Oylama Stüdyosu" : "Enterprise Survey & Poll Studio",
12788
- " —",
12789
- " ",
12790
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#93c5fd" }, children: draft.title })
12791
- ] }),
12792
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, color: "#94a3b8" }, children: [
12793
- "Slug: ",
12794
- /* @__PURE__ */ jsxRuntime.jsx("code", { children: draft.slug }),
12795
- " • Mode: ",
12796
- /* @__PURE__ */ jsxRuntime.jsx("code", { children: draft.displayMode }),
12797
- " • Submit:",
12798
- " ",
12799
- /* @__PURE__ */ jsxRuntime.jsxs("code", { children: [
12800
- "/api/content-input/surveys/",
12801
- draft.slug,
12802
- "/submit"
12803
- ] })
12804
- ] })
12805
- ] })
12796
+ /* @__PURE__ */ jsxRuntime.jsxs(
12797
+ "div",
12798
+ {
12799
+ onClick: () => setTab("settings"),
12800
+ 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",
12801
+ style: { cursor: "pointer" },
12802
+ children: [
12803
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 15, fontWeight: 700 }, children: [
12804
+ tr ? "Kurumsal Anket & Oylama Stüdyosu" : "Enterprise Survey & Poll Studio",
12805
+ " —",
12806
+ " ",
12807
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#93c5fd", textDecoration: "underline dotted" }, children: draft.title })
12808
+ ] }),
12809
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 11, color: "#94a3b8" }, children: [
12810
+ "Slug: ",
12811
+ /* @__PURE__ */ jsxRuntime.jsx("code", { children: draft.slug }),
12812
+ " • Mode: ",
12813
+ /* @__PURE__ */ jsxRuntime.jsx("code", { children: draft.displayMode }),
12814
+ " • Submit:",
12815
+ " ",
12816
+ /* @__PURE__ */ jsxRuntime.jsxs("code", { children: [
12817
+ "/api/content-input/surveys/",
12818
+ draft.slug,
12819
+ "/submit"
12820
+ ] })
12821
+ ] })
12822
+ ]
12823
+ }
12824
+ )
12806
12825
  ] }),
12807
12826
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
12808
12827
  statusMsg && /* @__PURE__ */ jsxRuntime.jsx(
@@ -14536,7 +14555,10 @@ const SurveyStudioModal = ({
14536
14555
  type: "text",
14537
14556
  value: activeQ.key,
14538
14557
  onChange: (e) => updateActiveQuestion({
14539
- key: slugifyKey(e.target.value) || activeQ.key
14558
+ key: sanitizeSlugInput(e.target.value)
14559
+ }),
14560
+ onBlur: (e) => updateActiveQuestion({
14561
+ key: slugifyKey(e.target.value) || `q_${activeQ.type}_${selectedQuestionIdx + 1}`
14540
14562
  }),
14541
14563
  style: { ...inputStyle, fontFamily: "monospace" }
14542
14564
  }
@@ -14836,7 +14858,16 @@ const SurveyStudioModal = ({
14836
14858
  value: opt.id,
14837
14859
  onChange: (e) => {
14838
14860
  const next = opts.map(
14839
- (x, i) => i === oIdx ? { ...x, id: slugifyKey(e.target.value) || x.id } : x
14861
+ (x, i) => i === oIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
14862
+ );
14863
+ saveOpts(next);
14864
+ },
14865
+ onBlur: (e) => {
14866
+ const next = opts.map(
14867
+ (x, i) => i === oIdx ? {
14868
+ ...x,
14869
+ id: slugifyKey(e.target.value) || `opt_${oIdx + 1}`
14870
+ } : x
14840
14871
  );
14841
14872
  saveOpts(next);
14842
14873
  },
@@ -14904,7 +14935,7 @@ const SurveyStudioModal = ({
14904
14935
  ) })
14905
14936
  ]
14906
14937
  },
14907
- `${opt.id}-${oIdx}`
14938
+ oIdx
14908
14939
  );
14909
14940
  }),
14910
14941
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -15408,7 +15439,16 @@ const SurveyStudioModal = ({
15408
15439
  value: r.id,
15409
15440
  onChange: (e) => {
15410
15441
  const next = mRows.map(
15411
- (x, i) => i === rIdx ? { ...x, id: slugifyKey(e.target.value) } : x
15442
+ (x, i) => i === rIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
15443
+ );
15444
+ updateActiveQuestion({ matrixRows: next });
15445
+ },
15446
+ onBlur: (e) => {
15447
+ const next = mRows.map(
15448
+ (x, i) => i === rIdx ? {
15449
+ ...x,
15450
+ id: slugifyKey(e.target.value) || `row_${rIdx + 1}`
15451
+ } : x
15412
15452
  );
15413
15453
  updateActiveQuestion({ matrixRows: next });
15414
15454
  },
@@ -15451,7 +15491,7 @@ const SurveyStudioModal = ({
15451
15491
  )
15452
15492
  ]
15453
15493
  },
15454
- r.id
15494
+ rIdx
15455
15495
  );
15456
15496
  })
15457
15497
  ] }),
@@ -15519,7 +15559,16 @@ const SurveyStudioModal = ({
15519
15559
  value: c.id,
15520
15560
  onChange: (e) => {
15521
15561
  const next = mCols.map(
15522
- (x, i) => i === cIdx ? { ...x, id: slugifyKey(e.target.value) } : x
15562
+ (x, i) => i === cIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
15563
+ );
15564
+ updateActiveQuestion({ matrixColumns: next });
15565
+ },
15566
+ onBlur: (e) => {
15567
+ const next = mCols.map(
15568
+ (x, i) => i === cIdx ? {
15569
+ ...x,
15570
+ id: slugifyKey(e.target.value) || `col_${cIdx + 1}`
15571
+ } : x
15523
15572
  );
15524
15573
  updateActiveQuestion({ matrixColumns: next });
15525
15574
  },
@@ -15562,7 +15611,7 @@ const SurveyStudioModal = ({
15562
15611
  )
15563
15612
  ]
15564
15613
  },
15565
- c.id
15614
+ cIdx
15566
15615
  );
15567
15616
  })
15568
15617
  ] })
@@ -15786,25 +15835,102 @@ const SurveyStudioModal = ({
15786
15835
  /* @__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
15836
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 10 }, children: [
15788
15837
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
15789
- /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle, children: tr ? "Yönetim Başlığı" : "Internal Title" }),
15838
+ /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle, children: tr ? "Yönetim Başlığı (Internal Title)" : "Survey Internal Title" }),
15790
15839
  /* @__PURE__ */ jsxRuntime.jsx(
15791
15840
  "input",
15792
15841
  {
15793
15842
  type: "text",
15794
15843
  value: draft.title,
15795
- onChange: (e) => setDraft({ ...draft, title: e.target.value }),
15844
+ onChange: (e) => {
15845
+ const nextTitle = e.target.value;
15846
+ setDraft((prev) => ({
15847
+ ...prev,
15848
+ title: nextTitle,
15849
+ ...slugAutoSync ? { slug: slugifyKey(nextTitle) } : {}
15850
+ }));
15851
+ },
15852
+ placeholder: tr ? "Örn: 2026 Müşteri Nabzı Anketi" : "e.g. 2026 Customer Pulse Survey",
15796
15853
  style: inputStyle
15797
15854
  }
15798
15855
  )
15799
15856
  ] }),
15800
15857
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
15801
- /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle, children: "Survey Slug" }),
15858
+ /* @__PURE__ */ jsxRuntime.jsxs(
15859
+ "div",
15860
+ {
15861
+ style: {
15862
+ display: "flex",
15863
+ alignItems: "center",
15864
+ justifyContent: "space-between",
15865
+ gap: 6,
15866
+ marginBottom: 4
15867
+ },
15868
+ children: [
15869
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { style: { ...labelStyle, marginBottom: 0 }, children: [
15870
+ "Survey Slug",
15871
+ " ",
15872
+ /* @__PURE__ */ jsxRuntime.jsx(
15873
+ "span",
15874
+ {
15875
+ style: {
15876
+ fontSize: 9.5,
15877
+ fontWeight: 700,
15878
+ padding: "1px 6px",
15879
+ borderRadius: 8,
15880
+ marginLeft: 4,
15881
+ background: slugAutoSync ? "#dbeafe" : "#f1f5f9",
15882
+ color: slugAutoSync ? "#1e40af" : "#475569"
15883
+ },
15884
+ children: slugAutoSync ? tr ? "Otomatik" : "Auto" : tr ? "Özel" : "Custom"
15885
+ }
15886
+ )
15887
+ ] }),
15888
+ /* @__PURE__ */ jsxRuntime.jsx(
15889
+ "button",
15890
+ {
15891
+ type: "button",
15892
+ onClick: () => {
15893
+ const generated = slugifyKey(draft.title);
15894
+ setDraft((prev) => ({
15895
+ ...prev,
15896
+ slug: generated || prev.slug
15897
+ }));
15898
+ setSlugAutoSync(true);
15899
+ },
15900
+ title: tr ? "Yönetim Başlığından (Internal Title) otomatik slug üret ve senkronla" : "Generate slug from Internal Title and keep synced",
15901
+ style: {
15902
+ padding: "1px 7px",
15903
+ borderRadius: 5,
15904
+ border: "1px solid #93c5fd",
15905
+ background: "#eff6ff",
15906
+ color: "#1d4ed8",
15907
+ fontSize: 10,
15908
+ fontWeight: 700,
15909
+ cursor: "pointer"
15910
+ },
15911
+ children: tr ? "↻ Başlıktan Üret" : "↻ From Title"
15912
+ }
15913
+ )
15914
+ ]
15915
+ }
15916
+ ),
15802
15917
  /* @__PURE__ */ jsxRuntime.jsx(
15803
15918
  "input",
15804
15919
  {
15805
15920
  type: "text",
15806
15921
  value: draft.slug,
15807
- onChange: (e) => setDraft({ ...draft, slug: slugifyKey(e.target.value) }),
15922
+ onChange: (e) => {
15923
+ setSlugAutoSync(false);
15924
+ setDraft((prev) => ({
15925
+ ...prev,
15926
+ slug: sanitizeSlugInput(e.target.value)
15927
+ }));
15928
+ },
15929
+ onBlur: (e) => {
15930
+ const cleaned = slugifyKey(e.target.value) || slugifyKey(draft.title) || `survey-${Date.now().toString(36).slice(-4)}`;
15931
+ setDraft((prev) => ({ ...prev, slug: cleaned }));
15932
+ },
15933
+ placeholder: "ornek-anket_2026",
15808
15934
  style: { ...inputStyle, fontFamily: "monospace" }
15809
15935
  }
15810
15936
  )
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import React, { useState, useMemo, useRef, createContext, useContext, useEffect, useCallback } from "react";
3
3
  import ReactDOM, { createPortal } from "react-dom";
4
4
  import { useFetchClient, useStrapiApp } from "@strapi/strapi/admin";
5
- import { M as MaterialIcon } from "./index-C5Uj5YV9.mjs";
5
+ import { M as MaterialIcon } from "./index-BdrFmPg5.mjs";
6
6
  import cloneDeep from "lodash/cloneDeep";
7
7
  const ROW_PRESETS = [
8
8
  {
@@ -12336,22 +12336,25 @@ const labelStyle = {
12336
12336
  color: "#475569",
12337
12337
  marginBottom: 4
12338
12338
  };
12339
+ const TURKISH_CHAR_MAP = {
12340
+ ç: "c",
12341
+ Ç: "c",
12342
+ ğ: "g",
12343
+ Ğ: "g",
12344
+ ı: "i",
12345
+ İ: "i",
12346
+ ö: "o",
12347
+ Ö: "o",
12348
+ ş: "s",
12349
+ Ş: "s",
12350
+ ü: "u",
12351
+ Ü: "u"
12352
+ };
12353
+ function sanitizeSlugInput(input) {
12354
+ return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => TURKISH_CHAR_MAP[ch] || ch).toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "");
12355
+ }
12339
12356
  function slugifyKey(input) {
12340
- const map = {
12341
- ç: "c",
12342
- Ç: "c",
12343
- ğ: "g",
12344
- Ğ: "g",
12345
- ı: "i",
12346
- İ: "i",
12347
- ö: "o",
12348
- Ö: "o",
12349
- ş: "s",
12350
- Ş: "s",
12351
- ü: "u",
12352
- Ü: "u"
12353
- };
12354
- return String(input || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
12357
+ 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, "");
12355
12358
  }
12356
12359
  const LIKERT_SCALE_PRESETS = [
12357
12360
  {
@@ -12457,13 +12460,14 @@ const QUESTION_TYPES_CATALOG = [
12457
12460
  function createBlankSurveyDraft(locale = "en") {
12458
12461
  const tr = locale === "tr";
12459
12462
  const ts = Date.now().toString(36).slice(-4);
12463
+ const initialTitle = tr ? "Yeni Müşteri Geri Bildirim Anketi" : "New Customer Feedback Survey";
12460
12464
  return {
12461
- title: tr ? "Yeni Müşteri Geri Bildirim Anketi" : "New Customer Feedback Survey",
12465
+ title: initialTitle,
12462
12466
  titleI18n: {
12463
12467
  en: "New Customer Feedback Survey",
12464
12468
  tr: "Yeni Müşteri Geri Bildirim Anketi"
12465
12469
  },
12466
- slug: `survey_${ts}`,
12470
+ slug: `${slugifyKey(initialTitle)}-${ts}`,
12467
12471
  description: {
12468
12472
  tr: "Görüşleriniz hizmet kalitemizi geliştirmemize yardımcı olur.",
12469
12473
  en: "Your feedback helps us improve our service quality."
@@ -12600,6 +12604,9 @@ const SurveyStudioModal = ({
12600
12604
  const [dropIndicator, setDropIndicator] = useState(null);
12601
12605
  const [saving, setSaving] = useState(false);
12602
12606
  const [statusMsg, setStatusMsg] = useState("");
12607
+ const [slugAutoSync, setSlugAutoSync] = useState(
12608
+ () => !initialSurvey.id && !initialSurvey.documentId && !initialSurvey._id
12609
+ );
12603
12610
  const [optDragReadyIdx, setOptDragReadyIdx] = useState(null);
12604
12611
  const [studioExportOpen, setStudioExportOpen] = useState(false);
12605
12612
  const [studioImportOpen, setStudioImportOpen] = useState(false);
@@ -12618,6 +12625,7 @@ const SurveyStudioModal = ({
12618
12625
  const cloned = JSON.parse(JSON.stringify(initialSurvey));
12619
12626
  const nextDraft = cloned.displayMode === "multi_step" ? normalizeMultiStepDraft(cloned) : cloned;
12620
12627
  setDraft(nextDraft);
12628
+ setSlugAutoSync(!cloned.id && !cloned.documentId && !cloned._id);
12621
12629
  setSelectedQuestionIdx(0);
12622
12630
  setCollapsedStepIds({});
12623
12631
  setOpenStepDescIds({});
@@ -12689,14 +12697,17 @@ const SurveyStudioModal = ({
12689
12697
  setSaving(true);
12690
12698
  setStatusMsg("");
12691
12699
  try {
12700
+ const cleanFinalSlug = slugifyKey(draft.slug) || slugifyKey(draft.title) || `survey-${Date.now().toString(36).slice(-4)}`;
12692
12701
  const payload = {
12693
12702
  ...draft,
12703
+ slug: cleanFinalSlug,
12694
12704
  id: draft.documentId || draft._id || draft.id
12695
12705
  };
12696
12706
  const res = await post("/content-input/surveys", payload);
12697
12707
  const saved = res?.data;
12698
12708
  if (saved) {
12699
12709
  setDraft(JSON.parse(JSON.stringify(saved)));
12710
+ setSlugAutoSync(false);
12700
12711
  setStatusMsg(tr ? "Anket kaydedildi!" : "Survey saved!");
12701
12712
  if (typeof window !== "undefined") {
12702
12713
  window.dispatchEvent(new CustomEvent("ci-survey-updated", { detail: saved }));
@@ -12777,27 +12788,35 @@ const SurveyStudioModal = ({
12777
12788
  children: [
12778
12789
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
12779
12790
  /* @__PURE__ */ jsx(MaterialIcon, { name: "poll", size: 22, color: "#38bdf8" }),
12780
- /* @__PURE__ */ jsxs("div", { children: [
12781
- /* @__PURE__ */ jsxs("div", { style: { fontSize: 15, fontWeight: 700 }, children: [
12782
- tr ? "Kurumsal Anket & Oylama Stüdyosu" : "Enterprise Survey & Poll Studio",
12783
- " —",
12784
- " ",
12785
- /* @__PURE__ */ jsx("span", { style: { color: "#93c5fd" }, children: draft.title })
12786
- ] }),
12787
- /* @__PURE__ */ jsxs("div", { style: { fontSize: 11, color: "#94a3b8" }, children: [
12788
- "Slug: ",
12789
- /* @__PURE__ */ jsx("code", { children: draft.slug }),
12790
- " • Mode: ",
12791
- /* @__PURE__ */ jsx("code", { children: draft.displayMode }),
12792
- " • Submit:",
12793
- " ",
12794
- /* @__PURE__ */ jsxs("code", { children: [
12795
- "/api/content-input/surveys/",
12796
- draft.slug,
12797
- "/submit"
12798
- ] })
12799
- ] })
12800
- ] })
12791
+ /* @__PURE__ */ jsxs(
12792
+ "div",
12793
+ {
12794
+ onClick: () => setTab("settings"),
12795
+ 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",
12796
+ style: { cursor: "pointer" },
12797
+ children: [
12798
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 15, fontWeight: 700 }, children: [
12799
+ tr ? "Kurumsal Anket & Oylama Stüdyosu" : "Enterprise Survey & Poll Studio",
12800
+ " —",
12801
+ " ",
12802
+ /* @__PURE__ */ jsx("span", { style: { color: "#93c5fd", textDecoration: "underline dotted" }, children: draft.title })
12803
+ ] }),
12804
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 11, color: "#94a3b8" }, children: [
12805
+ "Slug: ",
12806
+ /* @__PURE__ */ jsx("code", { children: draft.slug }),
12807
+ " • Mode: ",
12808
+ /* @__PURE__ */ jsx("code", { children: draft.displayMode }),
12809
+ " • Submit:",
12810
+ " ",
12811
+ /* @__PURE__ */ jsxs("code", { children: [
12812
+ "/api/content-input/surveys/",
12813
+ draft.slug,
12814
+ "/submit"
12815
+ ] })
12816
+ ] })
12817
+ ]
12818
+ }
12819
+ )
12801
12820
  ] }),
12802
12821
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
12803
12822
  statusMsg && /* @__PURE__ */ jsx(
@@ -14531,7 +14550,10 @@ const SurveyStudioModal = ({
14531
14550
  type: "text",
14532
14551
  value: activeQ.key,
14533
14552
  onChange: (e) => updateActiveQuestion({
14534
- key: slugifyKey(e.target.value) || activeQ.key
14553
+ key: sanitizeSlugInput(e.target.value)
14554
+ }),
14555
+ onBlur: (e) => updateActiveQuestion({
14556
+ key: slugifyKey(e.target.value) || `q_${activeQ.type}_${selectedQuestionIdx + 1}`
14535
14557
  }),
14536
14558
  style: { ...inputStyle, fontFamily: "monospace" }
14537
14559
  }
@@ -14831,7 +14853,16 @@ const SurveyStudioModal = ({
14831
14853
  value: opt.id,
14832
14854
  onChange: (e) => {
14833
14855
  const next = opts.map(
14834
- (x, i) => i === oIdx ? { ...x, id: slugifyKey(e.target.value) || x.id } : x
14856
+ (x, i) => i === oIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
14857
+ );
14858
+ saveOpts(next);
14859
+ },
14860
+ onBlur: (e) => {
14861
+ const next = opts.map(
14862
+ (x, i) => i === oIdx ? {
14863
+ ...x,
14864
+ id: slugifyKey(e.target.value) || `opt_${oIdx + 1}`
14865
+ } : x
14835
14866
  );
14836
14867
  saveOpts(next);
14837
14868
  },
@@ -14899,7 +14930,7 @@ const SurveyStudioModal = ({
14899
14930
  ) })
14900
14931
  ]
14901
14932
  },
14902
- `${opt.id}-${oIdx}`
14933
+ oIdx
14903
14934
  );
14904
14935
  }),
14905
14936
  /* @__PURE__ */ jsx(
@@ -15403,7 +15434,16 @@ const SurveyStudioModal = ({
15403
15434
  value: r.id,
15404
15435
  onChange: (e) => {
15405
15436
  const next = mRows.map(
15406
- (x, i) => i === rIdx ? { ...x, id: slugifyKey(e.target.value) } : x
15437
+ (x, i) => i === rIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
15438
+ );
15439
+ updateActiveQuestion({ matrixRows: next });
15440
+ },
15441
+ onBlur: (e) => {
15442
+ const next = mRows.map(
15443
+ (x, i) => i === rIdx ? {
15444
+ ...x,
15445
+ id: slugifyKey(e.target.value) || `row_${rIdx + 1}`
15446
+ } : x
15407
15447
  );
15408
15448
  updateActiveQuestion({ matrixRows: next });
15409
15449
  },
@@ -15446,7 +15486,7 @@ const SurveyStudioModal = ({
15446
15486
  )
15447
15487
  ]
15448
15488
  },
15449
- r.id
15489
+ rIdx
15450
15490
  );
15451
15491
  })
15452
15492
  ] }),
@@ -15514,7 +15554,16 @@ const SurveyStudioModal = ({
15514
15554
  value: c.id,
15515
15555
  onChange: (e) => {
15516
15556
  const next = mCols.map(
15517
- (x, i) => i === cIdx ? { ...x, id: slugifyKey(e.target.value) } : x
15557
+ (x, i) => i === cIdx ? { ...x, id: sanitizeSlugInput(e.target.value) } : x
15558
+ );
15559
+ updateActiveQuestion({ matrixColumns: next });
15560
+ },
15561
+ onBlur: (e) => {
15562
+ const next = mCols.map(
15563
+ (x, i) => i === cIdx ? {
15564
+ ...x,
15565
+ id: slugifyKey(e.target.value) || `col_${cIdx + 1}`
15566
+ } : x
15518
15567
  );
15519
15568
  updateActiveQuestion({ matrixColumns: next });
15520
15569
  },
@@ -15557,7 +15606,7 @@ const SurveyStudioModal = ({
15557
15606
  )
15558
15607
  ]
15559
15608
  },
15560
- c.id
15609
+ cIdx
15561
15610
  );
15562
15611
  })
15563
15612
  ] })
@@ -15781,25 +15830,102 @@ const SurveyStudioModal = ({
15781
15830
  /* @__PURE__ */ jsx("div", { style: { fontSize: 13, fontWeight: 700, color: "#0f172a" }, children: tr ? "Anket Kimliği & Çok Dilli Başlıklar" : "Survey Identity & Localized Titles" }),
15782
15831
  /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 10 }, children: [
15783
15832
  /* @__PURE__ */ jsxs("div", { children: [
15784
- /* @__PURE__ */ jsx("label", { style: labelStyle, children: tr ? "Yönetim Başlığı" : "Internal Title" }),
15833
+ /* @__PURE__ */ jsx("label", { style: labelStyle, children: tr ? "Yönetim Başlığı (Internal Title)" : "Survey Internal Title" }),
15785
15834
  /* @__PURE__ */ jsx(
15786
15835
  "input",
15787
15836
  {
15788
15837
  type: "text",
15789
15838
  value: draft.title,
15790
- onChange: (e) => setDraft({ ...draft, title: e.target.value }),
15839
+ onChange: (e) => {
15840
+ const nextTitle = e.target.value;
15841
+ setDraft((prev) => ({
15842
+ ...prev,
15843
+ title: nextTitle,
15844
+ ...slugAutoSync ? { slug: slugifyKey(nextTitle) } : {}
15845
+ }));
15846
+ },
15847
+ placeholder: tr ? "Örn: 2026 Müşteri Nabzı Anketi" : "e.g. 2026 Customer Pulse Survey",
15791
15848
  style: inputStyle
15792
15849
  }
15793
15850
  )
15794
15851
  ] }),
15795
15852
  /* @__PURE__ */ jsxs("div", { children: [
15796
- /* @__PURE__ */ jsx("label", { style: labelStyle, children: "Survey Slug" }),
15853
+ /* @__PURE__ */ jsxs(
15854
+ "div",
15855
+ {
15856
+ style: {
15857
+ display: "flex",
15858
+ alignItems: "center",
15859
+ justifyContent: "space-between",
15860
+ gap: 6,
15861
+ marginBottom: 4
15862
+ },
15863
+ children: [
15864
+ /* @__PURE__ */ jsxs("label", { style: { ...labelStyle, marginBottom: 0 }, children: [
15865
+ "Survey Slug",
15866
+ " ",
15867
+ /* @__PURE__ */ jsx(
15868
+ "span",
15869
+ {
15870
+ style: {
15871
+ fontSize: 9.5,
15872
+ fontWeight: 700,
15873
+ padding: "1px 6px",
15874
+ borderRadius: 8,
15875
+ marginLeft: 4,
15876
+ background: slugAutoSync ? "#dbeafe" : "#f1f5f9",
15877
+ color: slugAutoSync ? "#1e40af" : "#475569"
15878
+ },
15879
+ children: slugAutoSync ? tr ? "Otomatik" : "Auto" : tr ? "Özel" : "Custom"
15880
+ }
15881
+ )
15882
+ ] }),
15883
+ /* @__PURE__ */ jsx(
15884
+ "button",
15885
+ {
15886
+ type: "button",
15887
+ onClick: () => {
15888
+ const generated = slugifyKey(draft.title);
15889
+ setDraft((prev) => ({
15890
+ ...prev,
15891
+ slug: generated || prev.slug
15892
+ }));
15893
+ setSlugAutoSync(true);
15894
+ },
15895
+ title: tr ? "Yönetim Başlığından (Internal Title) otomatik slug üret ve senkronla" : "Generate slug from Internal Title and keep synced",
15896
+ style: {
15897
+ padding: "1px 7px",
15898
+ borderRadius: 5,
15899
+ border: "1px solid #93c5fd",
15900
+ background: "#eff6ff",
15901
+ color: "#1d4ed8",
15902
+ fontSize: 10,
15903
+ fontWeight: 700,
15904
+ cursor: "pointer"
15905
+ },
15906
+ children: tr ? "↻ Başlıktan Üret" : "↻ From Title"
15907
+ }
15908
+ )
15909
+ ]
15910
+ }
15911
+ ),
15797
15912
  /* @__PURE__ */ jsx(
15798
15913
  "input",
15799
15914
  {
15800
15915
  type: "text",
15801
15916
  value: draft.slug,
15802
- onChange: (e) => setDraft({ ...draft, slug: slugifyKey(e.target.value) }),
15917
+ onChange: (e) => {
15918
+ setSlugAutoSync(false);
15919
+ setDraft((prev) => ({
15920
+ ...prev,
15921
+ slug: sanitizeSlugInput(e.target.value)
15922
+ }));
15923
+ },
15924
+ onBlur: (e) => {
15925
+ const cleaned = slugifyKey(e.target.value) || slugifyKey(draft.title) || `survey-${Date.now().toString(36).slice(-4)}`;
15926
+ setDraft((prev) => ({ ...prev, slug: cleaned }));
15927
+ },
15928
+ placeholder: "ornek-anket_2026",
15803
15929
  style: { ...inputStyle, fontFamily: "monospace" }
15804
15930
  }
15805
15931
  )
@@ -156,7 +156,7 @@ const index = {
156
156
  },
157
157
  icon: PluginIcon,
158
158
  components: {
159
- Input: async () => Promise.resolve().then(() => require("./ContentInputField-DK97AIG0.js")).then((mod) => ({
159
+ Input: async () => Promise.resolve().then(() => require("./ContentInputField-CnVzTBNf.js")).then((mod) => ({
160
160
  default: mod.ContentInputField
161
161
  }))
162
162
  },
@@ -191,7 +191,7 @@ const index = {
191
191
  defaultMessage: "ContentInput Hub"
192
192
  },
193
193
  permissions: [],
194
- Component: () => Promise.resolve().then(() => require("./AnalyticsHubPage-ByOrVZCl.js")).then((mod) => ({
194
+ Component: () => Promise.resolve().then(() => require("./AnalyticsHubPage-0fb7chuv.js")).then((mod) => ({
195
195
  default: mod.AnalyticsHubPage
196
196
  })),
197
197
  position: 7
@@ -153,7 +153,7 @@ const index = {
153
153
  },
154
154
  icon: PluginIcon,
155
155
  components: {
156
- Input: async () => import("./ContentInputField-BoZHf0Ka.mjs").then((mod) => ({
156
+ Input: async () => import("./ContentInputField-C-fh5qGC.mjs").then((mod) => ({
157
157
  default: mod.ContentInputField
158
158
  }))
159
159
  },
@@ -188,7 +188,7 @@ const index = {
188
188
  defaultMessage: "ContentInput Hub"
189
189
  },
190
190
  permissions: [],
191
- Component: () => import("./AnalyticsHubPage-O-7pF2E5.mjs").then((mod) => ({
191
+ Component: () => import("./AnalyticsHubPage-BO6Lg1qh.mjs").then((mod) => ({
192
192
  default: mod.AnalyticsHubPage
193
193
  })),
194
194
  position: 7
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const index = require("./index-CHtB_Fa5.js");
3
+ const index = require("./index--fSIDKkt.js");
4
4
  require("react");
5
5
  exports.default = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "./index-C5Uj5YV9.mjs";
1
+ import { i } from "./index-BdrFmPg5.mjs";
2
2
  import "react";
3
3
  export {
4
4
  i as default
@@ -4744,7 +4744,7 @@ function slugifyIdentifier$1(text) {
4744
4744
  ü: "u",
4745
4745
  Ü: "u"
4746
4746
  };
4747
- return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
4747
+ return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
4748
4748
  }
4749
4749
  function stripHtmlTags(html) {
4750
4750
  return String(html || "").replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&nbsp;/gi, " ").replace(/&amp;/gi, "&").replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/\s+/g, " ").trim();
@@ -6376,7 +6376,7 @@ function slugifyIdentifier(text) {
6376
6376
  ü: "u",
6377
6377
  Ü: "u"
6378
6378
  };
6379
- return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
6379
+ return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
6380
6380
  }
6381
6381
  function getEnvRecaptchaPublicKey() {
6382
6382
  return (process.env.MIX_RECAPTCHA_PUBLIC_KEY || process.env.RECAPTCHA_PUBLIC_KEY || process.env.NUXT_PUBLIC_RECAPTCHA_SITE_KEY || "").trim();
@@ -6754,9 +6754,7 @@ const ciSurveyService = ({ strapi }) => ({
6754
6754
  },
6755
6755
  async save(payload) {
6756
6756
  const cleanTitle = String(payload.title || "Yeni Anket").trim();
6757
- const cleanSlug = String(
6758
- payload.slug || slugifyIdentifier(cleanTitle) || `survey_${Date.now()}`
6759
- ).trim();
6757
+ const cleanSlug = slugifyIdentifier(String(payload.slug || "")) || slugifyIdentifier(cleanTitle) || `survey_${Date.now()}`;
6760
6758
  let existing = null;
6761
6759
  if (payload.id) {
6762
6760
  const rawId = String(payload.id).trim();
@@ -4719,7 +4719,7 @@ function slugifyIdentifier$1(text) {
4719
4719
  ü: "u",
4720
4720
  Ü: "u"
4721
4721
  };
4722
- return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
4722
+ return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
4723
4723
  }
4724
4724
  function stripHtmlTags(html) {
4725
4725
  return String(html || "").replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<[^>]+>/g, " ").replace(/&nbsp;/gi, " ").replace(/&amp;/gi, "&").replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/\s+/g, " ").trim();
@@ -6351,7 +6351,7 @@ function slugifyIdentifier(text) {
6351
6351
  ü: "u",
6352
6352
  Ü: "u"
6353
6353
  };
6354
- return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
6354
+ return String(text || "").replace(/[çÇğĞıİöÖşŞüÜ]/g, (ch) => map[ch] || ch).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-{2,}/g, "-").replace(/_{2,}/g, "_").replace(/^[-_]+|[-_]+$/g, "");
6355
6355
  }
6356
6356
  function getEnvRecaptchaPublicKey() {
6357
6357
  return (process.env.MIX_RECAPTCHA_PUBLIC_KEY || process.env.RECAPTCHA_PUBLIC_KEY || process.env.NUXT_PUBLIC_RECAPTCHA_SITE_KEY || "").trim();
@@ -6729,9 +6729,7 @@ const ciSurveyService = ({ strapi }) => ({
6729
6729
  },
6730
6730
  async save(payload) {
6731
6731
  const cleanTitle = String(payload.title || "Yeni Anket").trim();
6732
- const cleanSlug = String(
6733
- payload.slug || slugifyIdentifier(cleanTitle) || `survey_${Date.now()}`
6734
- ).trim();
6732
+ const cleanSlug = slugifyIdentifier(String(payload.slug || "")) || slugifyIdentifier(cleanTitle) || `survey_${Date.now()}`;
6735
6733
  let existing = null;
6736
6734
  if (payload.id) {
6737
6735
  const rawId = String(payload.id).trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozguraltan/strapi-content-input",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Locomotive CMS ContentInput visual page/content builder ported to Strapi v5 as a native JSONB Custom Field plugin.",
5
5
  "license": "MIT",
6
6
  "author": "Ozgur Altan <ozguraltan05@gmail.com>",