@ozguraltan/strapi-content-input 1.0.26 → 1.0.27
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 +8 -2
- package/dist/admin/{AnalyticsHubPage-Crz4vv46.mjs → AnalyticsHubPage-1d4lx37k.mjs} +30 -52
- package/dist/admin/{AnalyticsHubPage-CHlhvUIU.js → AnalyticsHubPage-BzKx8DTv.js} +30 -70
- package/dist/admin/{ContentInputField-BeKDx_bb.mjs → ContentInputField-DQvPlNcD.mjs} +427 -11
- package/dist/admin/{ContentInputField-CNWVLuRt.js → ContentInputField-DgS2wZNb.js} +427 -29
- package/dist/admin/{SurveyWidgetEditor-GKRT3eHj.mjs → SurveyWidgetEditor-BZHyY2eb.mjs} +2445 -3
- package/dist/admin/{SurveyWidgetEditor-BTipBBEU.js → SurveyWidgetEditor-k7kA6LQT.js} +2445 -3
- package/dist/admin/{index-DuJM60tO.js → index-BvofXe07.js} +2 -2
- package/dist/admin/{index-DSDcG4QW.mjs → index-CStmbvTw.mjs} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/analytics/ExcelReportStudioModal.d.ts +17 -0
- package/dist/admin/src/core/xlsxBrowserReader.d.ts +11 -0
- package/dist/server/index.js +3075 -1625
- package/dist/server/index.mjs +3075 -1607
- package/dist/server/src/controllers/ci-form.d.ts +1 -0
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/index.d.ts +8 -1
- package/dist/server/src/services/ci-form.d.ts +6 -1
- package/dist/server/src/services/ci-survey.d.ts +2 -1
- package/dist/server/src/services/index.d.ts +7 -1
- package/dist/server/src/utils/surveyEngine.d.ts +3 -1
- package/dist/server/src/utils/xlsxReportBuilder.d.ts +38 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -258,7 +258,7 @@ Powered by official **Swiper.js** (`EffectFade`, `EffectCreative`, `EffectCoverf
|
|
|
258
258
|
|
|
259
259
|
### 5.3 Interactive Data Table (`dataTable`)
|
|
260
260
|
Supports **Excel / CSV File Upload**, **Clipboard Paste**, and **Live Strapi Collection** data sources:
|
|
261
|
-
1. **Excel (`.xlsx
|
|
261
|
+
1. **Excel (`.xlsx`) & CSV (`.csv`, `.tsv`) File Upload + Paste Importer (`sourceMode: 'manual'`):** Upload `.xlsx`, `.csv`, or `.tsv` files via drag-and-drop dropzone (powered by the hardened zero-dependency `xlsxBrowserReader.ts` engine using W3C `DecompressionStream('deflate-raw')` + `DOMParser` with `25 MB` zip-bomb & prototype-pollution guards, multi-sheet workbook selector, replace vs append mode, and automatic column type inference), paste directly from Excel / Google Sheets, or edit typed cells inline.
|
|
262
262
|
2. **Live Strapi Collection Source + Selectable Fields (`sourceMode: 'strapi_collection'`):** Connect to any allowed Strapi Collection-Type (`GET ${baseUrl}/api/content-input/data-table?uid=api::page.page`), interactively pick **which collection fields** to display via an `availableFields` checklist, reorder columns, customize column headers/formats, and preview live records (`private` / `password` fields and `admin::*` UIDs are strictly blocked on the server).
|
|
263
263
|
3. **Fixed (Sticky) Header + Horizontal & Vertical Scroll:** Configure `stickyHeader` (pins `<thead>` at `top: 0` while scrolling), `verticalScroll` + `maxHeight` (e.g. `360px`–`480px`), `horizontalScroll` + `minTableWidth` (e.g. `960px`–`1040px`), `stickyFirstColumn` (pins the first column at `left: 0` during horizontal scroll), and Color Codes `headerBgColor` / `headerTextColor`.
|
|
264
264
|
4. **9 Rich Column Formats & Interactive Visitor Toolbar:** `text`, `number`, `currency`, `progress` (visual progress bar), `badge` (mapped to Color Codes semantic colors), `boolean`, `image` (with click-to-zoom lightbox), `date`, `link` — plus live search, column sorting, quick filter chips, pagination, summary footer (`SUM` / `AVG` / `COUNT`), zebra striping, and 1-click visitor **CSV Export**.
|
|
@@ -343,7 +343,13 @@ Reporting is available in **two places** inside Strapi Admin:
|
|
|
343
343
|
- Global dashboard for all surveys, polls, and dynamic form submissions.
|
|
344
344
|
- **4 KPI Cards:** Total Responses & Quota progress, Average & Median Completion Time (`durationMs`), Net Promoter Score (`-100..+100`) stacked bar, and Locale breakdown.
|
|
345
345
|
- **30-Day Daily Participation Trend** bar chart + Date Range (`from`/`to`) & `Locale` filters.
|
|
346
|
-
- **
|
|
346
|
+
- **Corporate 3-Sheet Executive Excel (`.xlsx`) + Live Excel Report Studio (`GET` / `POST /content-input/surveys/:id/export`):**
|
|
347
|
+
- **Zero-`zlib` & Zero-CVE OOXML Engine (`xlsxReportBuilder.ts`):** Generates standards-compliant ECMA-376 `.xlsx` archives using pure TypeScript `ZIP STORE` (`method = 0`) + CRC-32 (`0` production CVEs, no native `zlib` or third-party spreadsheet dependencies) and automatically inherits the active **Color Codes** brand primary color.
|
|
348
|
+
- **3-Sheet Hybrid Workbook:**
|
|
349
|
+
1. **`1_Dashboard`:** Corporate color header banner, 4 KPI cards (Total Responses, Avg/Median Time, semantic green/amber/red NPS Score, Locale Mix), optional Executive Summary Note, **30-Day Participation `<c:lineChart>`**, and a 2-column grid of **100% real, editable native Excel DrawingML charts** (`<c:barChart>` horizontal bar / vertical column & `<c:doughnutChart>`) live-linked via formulas (`='2_Ozet_Istatistik'!$B$...:$C$...`) to Sheet 2.
|
|
350
|
+
2. **`2_Ozet_Istatistik` (`2_Summary_Stats`):** Structured statistical tables per question with native Excel **Conditional Data Bars** (`<cfRule type="dataBar">`) on `%` columns (`0.0%`), **Color Scale Heatmaps** (`<cfRule type="colorScale">`) on `matrix_single` grids, and slate-italic `"Fikrim yok / No idea"` rows.
|
|
351
|
+
3. **`3_Ham_Yanitlar` (`3_Raw_Responses`):** Frozen header (`ySplit="3"`), active `AutoFilter`, zebra striping, semantic NPS category badges, and auto-fitted columns.
|
|
352
|
+
- **Visual Excel Preview & Customizer Modal (`ExcelReportStudioModal.tsx`):** Click **`🎨 Excel Önizle & Düzenle`** (`Customize & Preview .xlsx`) alongside 1-click `.xlsx` / `.csv` / `.json` export to preview all 3 tabs live in Strapi, edit the report banner title & executive note directly on the document, pick Color Codes / `#HEX` themes, and toggle per-question chart types (`Bar` | `Column` | `Doughnut` | `Table Only`) before downloading, plus styled server-side `.xlsx` export for Dynamic Form submissions (`GET /content-input/forms/submissions/export`).
|
|
347
353
|
2. **Inline `Survey Studio Modal` -> `Tab 2: Live Flow Preview & Simulator` & `Tab 4: Analytics & Reports`:**
|
|
348
354
|
- **`Tab 2: Live Flow Preview & Simulator` (`SurveyLivePreviewPane`):** Interactive sandbox inside the Survey Studio modal (works directly against unsaved `draft` state without polluting live analytics DB) with **Desktop / Tablet / Mobile** viewport switcher, **Strapi `i18n` test locale** switcher, full multi-step wizard & validation testing across all 13 question types, **Reset Flow**, and a real-time **Skip Logic Visibility & JSON Payload Inspector**.
|
|
349
355
|
- **`Tab 4: Analytics & Reports`:** View live charts for the selected survey directly inside the Content Manager page editor.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useCallback, useEffect } from "react";
|
|
3
3
|
import { useFetchClient } from "@strapi/strapi/admin";
|
|
4
|
-
import
|
|
5
|
-
import { M as
|
|
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-GKRT3eHj.mjs";
|
|
7
|
-
const XLSX = XLSXNs?.utils ? XLSXNs : XLSXNs?.default || XLSXNs;
|
|
4
|
+
import { M as MaterialIcon } from "./index-CStmbvTw.mjs";
|
|
5
|
+
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-BZHyY2eb.mjs";
|
|
8
6
|
const AnalyticsHubPage = () => {
|
|
9
7
|
const { get, post } = useFetchClient();
|
|
10
8
|
const { locales: strapiLocales } = useStrapiLocales();
|
|
@@ -125,56 +123,36 @@ const AnalyticsHubPage = () => {
|
|
|
125
123
|
document.body.removeChild(a);
|
|
126
124
|
URL.revokeObjectURL(url);
|
|
127
125
|
};
|
|
128
|
-
const exportFormSubmissionsXlsx = () => {
|
|
126
|
+
const exportFormSubmissionsXlsx = async () => {
|
|
129
127
|
if (submissions.length === 0) return;
|
|
130
|
-
|
|
131
|
-
new
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return String(v);
|
|
144
|
-
};
|
|
145
|
-
const aoa = [headers];
|
|
146
|
-
for (const s of submissions) {
|
|
147
|
-
aoa.push([
|
|
148
|
-
String(s.id || s.documentId || ""),
|
|
149
|
-
String(s.formTitle || s.formSlug || ""),
|
|
150
|
-
String(s.createdAt || ""),
|
|
151
|
-
s.mailSent ? "Yes" : "No",
|
|
152
|
-
...dataKeys.map((k) => formatCell(s.data?.[k]))
|
|
153
|
-
]);
|
|
154
|
-
}
|
|
155
|
-
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
|
156
|
-
ws["!cols"] = headers.map((h, cIdx) => {
|
|
157
|
-
let maxLen = Math.max(12, h.length);
|
|
158
|
-
for (let r = 1; r < Math.min(aoa.length, 250); r++) {
|
|
159
|
-
const len = String(aoa[r]?.[cIdx] ?? "").length;
|
|
160
|
-
if (len > maxLen) maxLen = len;
|
|
128
|
+
try {
|
|
129
|
+
const qs = new URLSearchParams({
|
|
130
|
+
formSlug: selectedFormSlug,
|
|
131
|
+
locale: uiLocale,
|
|
132
|
+
encoding: "base64"
|
|
133
|
+
});
|
|
134
|
+
const res = await get(`/content-input/forms/submissions/export?${qs.toString()}`);
|
|
135
|
+
const payload = res?.data;
|
|
136
|
+
if (!payload?.base64) return;
|
|
137
|
+
const binStr = window.atob(String(payload.base64));
|
|
138
|
+
const bytes = new Uint8Array(binStr.length);
|
|
139
|
+
for (let i = 0; i < binStr.length; i++) {
|
|
140
|
+
bytes[i] = binStr.charCodeAt(i);
|
|
161
141
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
document.body.removeChild(a);
|
|
177
|
-
URL.revokeObjectURL(url);
|
|
142
|
+
const blob = new Blob([bytes], {
|
|
143
|
+
type: payload.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
144
|
+
});
|
|
145
|
+
const url = URL.createObjectURL(blob);
|
|
146
|
+
const a = document.createElement("a");
|
|
147
|
+
a.href = url;
|
|
148
|
+
a.download = payload.filename || `form-submissions-${selectedFormSlug}.xlsx`;
|
|
149
|
+
document.body.appendChild(a);
|
|
150
|
+
a.click();
|
|
151
|
+
document.body.removeChild(a);
|
|
152
|
+
URL.revokeObjectURL(url);
|
|
153
|
+
} catch {
|
|
154
|
+
exportFormSubmissionsCsv();
|
|
155
|
+
}
|
|
178
156
|
};
|
|
179
157
|
const currentSurvey = surveys.find((s) => s.slug === selectedSurveySlug) || surveys[0] || null;
|
|
180
158
|
const totalAllResponses = surveys.reduce((acc, s) => acc + (s.responseCount || 0), 0);
|
|
@@ -3,28 +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 admin = require("@strapi/strapi/admin");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const SurveyWidgetEditor = require("./SurveyWidgetEditor-BTipBBEU.js");
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
|
-
if (e) {
|
|
13
|
-
for (const k in e) {
|
|
14
|
-
if (k !== "default") {
|
|
15
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: () => e[k]
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
n.default = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
const XLSXNs__namespace = /* @__PURE__ */ _interopNamespace(XLSXNs);
|
|
27
|
-
const XLSX = XLSXNs__namespace?.utils ? XLSXNs__namespace : XLSXNs__namespace?.default || XLSXNs__namespace;
|
|
6
|
+
const index = require("./index-BvofXe07.js");
|
|
7
|
+
const SurveyWidgetEditor = require("./SurveyWidgetEditor-k7kA6LQT.js");
|
|
28
8
|
const AnalyticsHubPage = () => {
|
|
29
9
|
const { get, post } = admin.useFetchClient();
|
|
30
10
|
const { locales: strapiLocales } = SurveyWidgetEditor.useStrapiLocales();
|
|
@@ -145,56 +125,36 @@ const AnalyticsHubPage = () => {
|
|
|
145
125
|
document.body.removeChild(a);
|
|
146
126
|
URL.revokeObjectURL(url);
|
|
147
127
|
};
|
|
148
|
-
const exportFormSubmissionsXlsx = () => {
|
|
128
|
+
const exportFormSubmissionsXlsx = async () => {
|
|
149
129
|
if (submissions.length === 0) return;
|
|
150
|
-
|
|
151
|
-
new
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return String(v);
|
|
164
|
-
};
|
|
165
|
-
const aoa = [headers];
|
|
166
|
-
for (const s of submissions) {
|
|
167
|
-
aoa.push([
|
|
168
|
-
String(s.id || s.documentId || ""),
|
|
169
|
-
String(s.formTitle || s.formSlug || ""),
|
|
170
|
-
String(s.createdAt || ""),
|
|
171
|
-
s.mailSent ? "Yes" : "No",
|
|
172
|
-
...dataKeys.map((k) => formatCell(s.data?.[k]))
|
|
173
|
-
]);
|
|
174
|
-
}
|
|
175
|
-
const ws = XLSX.utils.aoa_to_sheet(aoa);
|
|
176
|
-
ws["!cols"] = headers.map((h, cIdx) => {
|
|
177
|
-
let maxLen = Math.max(12, h.length);
|
|
178
|
-
for (let r = 1; r < Math.min(aoa.length, 250); r++) {
|
|
179
|
-
const len = String(aoa[r]?.[cIdx] ?? "").length;
|
|
180
|
-
if (len > maxLen) maxLen = len;
|
|
130
|
+
try {
|
|
131
|
+
const qs = new URLSearchParams({
|
|
132
|
+
formSlug: selectedFormSlug,
|
|
133
|
+
locale: uiLocale,
|
|
134
|
+
encoding: "base64"
|
|
135
|
+
});
|
|
136
|
+
const res = await get(`/content-input/forms/submissions/export?${qs.toString()}`);
|
|
137
|
+
const payload = res?.data;
|
|
138
|
+
if (!payload?.base64) return;
|
|
139
|
+
const binStr = window.atob(String(payload.base64));
|
|
140
|
+
const bytes = new Uint8Array(binStr.length);
|
|
141
|
+
for (let i = 0; i < binStr.length; i++) {
|
|
142
|
+
bytes[i] = binStr.charCodeAt(i);
|
|
181
143
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
document.body.removeChild(a);
|
|
197
|
-
URL.revokeObjectURL(url);
|
|
144
|
+
const blob = new Blob([bytes], {
|
|
145
|
+
type: payload.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
146
|
+
});
|
|
147
|
+
const url = URL.createObjectURL(blob);
|
|
148
|
+
const a = document.createElement("a");
|
|
149
|
+
a.href = url;
|
|
150
|
+
a.download = payload.filename || `form-submissions-${selectedFormSlug}.xlsx`;
|
|
151
|
+
document.body.appendChild(a);
|
|
152
|
+
a.click();
|
|
153
|
+
document.body.removeChild(a);
|
|
154
|
+
URL.revokeObjectURL(url);
|
|
155
|
+
} catch {
|
|
156
|
+
exportFormSubmissionsCsv();
|
|
157
|
+
}
|
|
198
158
|
};
|
|
199
159
|
const currentSurvey = surveys.find((s) => s.slug === selectedSurveySlug) || surveys[0] || null;
|
|
200
160
|
const totalAllResponses = surveys.reduce((acc, s) => acc + (s.responseCount || 0), 0);
|