@ozguraltan/strapi-content-input 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/admin/{AnalyticsHubPage-K_trli5i.js → AnalyticsHubPage-ByOrVZCl.js} +372 -7
- package/dist/admin/{AnalyticsHubPage-Dvpx3KsP.mjs → AnalyticsHubPage-O-7pF2E5.mjs} +372 -7
- package/dist/admin/{ContentInputField-C2kmtUwD.mjs → ContentInputField-BoZHf0Ka.mjs} +2 -2
- package/dist/admin/{ContentInputField-CjxYYEps.js → ContentInputField-DK97AIG0.js} +2 -2
- package/dist/admin/{SurveyWidgetEditor-DOYxWop9.js → SurveyWidgetEditor-D3KiAotu.js} +2927 -302
- package/dist/admin/{SurveyWidgetEditor-DMWOkHUt.mjs → SurveyWidgetEditor-Y5BR-NWE.mjs} +2928 -304
- package/dist/admin/{index-AePRA0IB.mjs → index-C5Uj5YV9.mjs} +2 -2
- package/dist/admin/{index-B9C8Qrfd.js → index-CHtB_Fa5.js} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/widgets/SurveyTransferCleanupModal.d.ts +35 -0
- package/dist/admin/src/components/widgets/surveyStepTreeOps.d.ts +54 -0
- package/dist/server/index.js +613 -20
- package/dist/server/index.mjs +613 -20
- package/dist/server/src/controllers/ci-survey.d.ts +4 -0
- package/dist/server/src/controllers/index.d.ts +4 -0
- package/dist/server/src/index.d.ts +46 -1
- package/dist/server/src/services/ci-form.d.ts +5 -1
- package/dist/server/src/services/ci-survey.d.ts +37 -0
- package/dist/server/src/services/index.d.ts +42 -1
- package/dist/server/src/utils/demoSeedState.d.ts +14 -0
- package/package.json +1 -1
|
@@ -153,7 +153,7 @@ const index = {
|
|
|
153
153
|
},
|
|
154
154
|
icon: PluginIcon,
|
|
155
155
|
components: {
|
|
156
|
-
Input: async () => import("./ContentInputField-
|
|
156
|
+
Input: async () => import("./ContentInputField-BoZHf0Ka.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-
|
|
191
|
+
Component: () => import("./AnalyticsHubPage-O-7pF2E5.mjs").then((mod) => ({
|
|
192
192
|
default: mod.AnalyticsHubPage
|
|
193
193
|
})),
|
|
194
194
|
position: 7
|
|
@@ -156,7 +156,7 @@ const index = {
|
|
|
156
156
|
},
|
|
157
157
|
icon: PluginIcon,
|
|
158
158
|
components: {
|
|
159
|
-
Input: async () => Promise.resolve().then(() => require("./ContentInputField-
|
|
159
|
+
Input: async () => Promise.resolve().then(() => require("./ContentInputField-DK97AIG0.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-
|
|
194
|
+
Component: () => Promise.resolve().then(() => require("./AnalyticsHubPage-ByOrVZCl.js")).then((mod) => ({
|
|
195
195
|
default: mod.AnalyticsHubPage
|
|
196
196
|
})),
|
|
197
197
|
position: 7
|
package/dist/admin/index.js
CHANGED
|
@@ -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-
|
|
3
|
+
const index = require("./index-CHtB_Fa5.js");
|
|
4
4
|
require("react");
|
|
5
5
|
exports.default = index.index;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CISurveyRecord } from './SurveyWidgetEditor';
|
|
3
|
+
export interface SurveyExportModalProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
uiLocale?: string;
|
|
6
|
+
targetSurvey?: CISurveyRecord | null;
|
|
7
|
+
allowAllSurveys?: boolean;
|
|
8
|
+
defaultScope?: 'single' | 'all';
|
|
9
|
+
totalSurveysCount?: number;
|
|
10
|
+
isUnsavedDraft?: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const SurveyExportModal: React.FC<SurveyExportModalProps>;
|
|
14
|
+
export interface SurveyImportModalProps {
|
|
15
|
+
open: boolean;
|
|
16
|
+
uiLocale?: string;
|
|
17
|
+
existingSlugs?: string[];
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
onImported: (result: {
|
|
20
|
+
importedCount: number;
|
|
21
|
+
importedResponsesCount: number;
|
|
22
|
+
importedSurveys: CISurveyRecord[];
|
|
23
|
+
}) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const SurveyImportModal: React.FC<SurveyImportModalProps>;
|
|
26
|
+
export type CleanupActionKind = 'purge-demo' | 'clear-responses' | 'delete-survey';
|
|
27
|
+
export interface SurveyCleanupConfirmModalProps {
|
|
28
|
+
open: boolean;
|
|
29
|
+
action: CleanupActionKind | null;
|
|
30
|
+
uiLocale?: string;
|
|
31
|
+
targetSurvey?: CISurveyRecord | null;
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
onCompleted: (action: CleanupActionKind, payload?: any) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const SurveyCleanupConfirmModal: React.FC<SurveyCleanupConfirmModalProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CISurveyQuestionDef, CISurveyRecord, CISurveyStepDef } from './SurveyWidgetEditor';
|
|
2
|
+
export interface QuestionDropTarget {
|
|
3
|
+
stepId: string;
|
|
4
|
+
targetQuestionKey?: string;
|
|
5
|
+
position?: 'before' | 'after' | 'end';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Ensures `steps` is non-empty for multi_step surveys, assigns any orphaned/unassigned
|
|
9
|
+
* questions to the first step, and orders `questions` canonically by `(stepIndex, intraStepOrder)`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeMultiStepDraft(draft: CISurveyRecord): CISurveyRecord;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a map of `stepId -> Array<{ question, globalIndex, stepIndex }>` for rendering
|
|
14
|
+
* Step Accordions cleanly.
|
|
15
|
+
*/
|
|
16
|
+
export declare function groupQuestionsByStep(questions: CISurveyQuestionDef[], steps: CISurveyStepDef[]): Map<string, Array<{
|
|
17
|
+
question: CISurveyQuestionDef;
|
|
18
|
+
globalIndex: number;
|
|
19
|
+
localIndex: number;
|
|
20
|
+
}>>;
|
|
21
|
+
/**
|
|
22
|
+
* Reorders a step (category) relative to another step ('before' or 'after'),
|
|
23
|
+
* and re-normalizes `draft.questions` so global question order matches the new step order.
|
|
24
|
+
*/
|
|
25
|
+
export declare function reorderStepsInDraft(draft: CISurveyRecord, sourceStepId: string, targetStepId: string, position?: 'before' | 'after'): CISurveyRecord;
|
|
26
|
+
/**
|
|
27
|
+
* Moves a step up (`delta = -1`) or down (`delta = 1`) by one slot.
|
|
28
|
+
*/
|
|
29
|
+
export declare function shiftStepByOffset(draft: CISurveyRecord, stepId: string, delta: -1 | 1): CISurveyRecord;
|
|
30
|
+
/**
|
|
31
|
+
* Moves an existing question within its current step OR across different steps (categories),
|
|
32
|
+
* updating `stepId` automatically and preserving canonical step ordering.
|
|
33
|
+
*/
|
|
34
|
+
export declare function moveQuestionInMultiStepDraft(draft: CISurveyRecord, sourceQuestionKey: string, target: QuestionDropTarget): CISurveyRecord;
|
|
35
|
+
/**
|
|
36
|
+
* Inserts a newly created question directly into a specific step (at a specific position or at the end).
|
|
37
|
+
*/
|
|
38
|
+
export declare function insertQuestionInMultiStepDraft(draft: CISurveyRecord, newQuestion: CISurveyQuestionDef, target: QuestionDropTarget): {
|
|
39
|
+
draft: CISurveyRecord;
|
|
40
|
+
insertedIndex: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Reorders a question in flat mode (`single_page` or `quick_poll`) using 'before' | 'after' semantics.
|
|
44
|
+
*/
|
|
45
|
+
export declare function reorderFlatQuestions(questions: CISurveyQuestionDef[], sourceKey: string, targetKey: string, position?: 'before' | 'after'): CISurveyQuestionDef[];
|
|
46
|
+
/**
|
|
47
|
+
* Deletes a step when `steps.length > 1` and safely reassigns its questions to the adjacent
|
|
48
|
+
* remaining step so no question ever becomes orphaned.
|
|
49
|
+
*/
|
|
50
|
+
export declare function deleteStepWithQuestionReassignment(draft: CISurveyRecord, stepIdToDelete: string): {
|
|
51
|
+
draft: CISurveyRecord;
|
|
52
|
+
fallbackStepId: string;
|
|
53
|
+
movedQuestionCount: number;
|
|
54
|
+
};
|