@ozguraltan/strapi-content-input 1.0.22 → 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.
Files changed (26) hide show
  1. package/README.md +14 -9
  2. package/dist/admin/{AnalyticsHubPage-B1_chQkG.js → AnalyticsHubPage-ByOrVZCl.js} +555 -59
  3. package/dist/admin/{AnalyticsHubPage-DUj3D2kA.mjs → AnalyticsHubPage-O-7pF2E5.mjs} +537 -59
  4. package/dist/admin/{ContentInputField-BrtpTCDd.mjs → ContentInputField-BoZHf0Ka.mjs} +6 -236
  5. package/dist/admin/{ContentInputField-CQFQxxgm.js → ContentInputField-DK97AIG0.js} +22 -252
  6. package/dist/admin/{SurveyWidgetEditor-C5Uvyf_h.js → SurveyWidgetEditor-D3KiAotu.js} +6133 -514
  7. package/dist/admin/{SurveyWidgetEditor-DGSwgTzR.mjs → SurveyWidgetEditor-Y5BR-NWE.mjs} +6157 -539
  8. package/dist/admin/{index-Dc7AFLOj.mjs → index-C5Uj5YV9.mjs} +2 -2
  9. package/dist/admin/{index-i0NfSYto.js → index-CHtB_Fa5.js} +2 -2
  10. package/dist/admin/index.js +1 -1
  11. package/dist/admin/index.mjs +1 -1
  12. package/dist/admin/src/components/widgets/SurveyLivePreviewPane.d.ts +9 -0
  13. package/dist/admin/src/components/widgets/SurveyTransferCleanupModal.d.ts +35 -0
  14. package/dist/admin/src/components/widgets/SurveyWidgetEditor.d.ts +3 -1
  15. package/dist/admin/src/components/widgets/surveyStepTreeOps.d.ts +54 -0
  16. package/dist/server/index.js +796 -32
  17. package/dist/server/index.mjs +778 -32
  18. package/dist/server/src/controllers/ci-survey.d.ts +4 -0
  19. package/dist/server/src/controllers/index.d.ts +4 -0
  20. package/dist/server/src/index.d.ts +56 -2
  21. package/dist/server/src/services/ci-form.d.ts +5 -1
  22. package/dist/server/src/services/ci-survey.d.ts +47 -1
  23. package/dist/server/src/services/index.d.ts +52 -2
  24. package/dist/server/src/utils/demoSeedState.d.ts +14 -0
  25. package/dist/server/src/utils/surveyEngine.d.ts +5 -0
  26. package/package.json +1 -1
@@ -14,5 +14,9 @@ declare const ciSurveyController: ({ strapi }: {
14
14
  responses(ctx: any): Promise<void>;
15
15
  exportResponses(ctx: any): Promise<any>;
16
16
  reseedDemo(ctx: any): Promise<void>;
17
+ purgeDemo(ctx: any): Promise<void>;
18
+ clearResponses(ctx: any): Promise<any>;
19
+ exportBundle(ctx: any): Promise<any>;
20
+ importBundle(ctx: any): Promise<any>;
17
21
  };
18
22
  export default ciSurveyController;
@@ -56,6 +56,10 @@ declare const _default: {
56
56
  responses(ctx: any): Promise<void>;
57
57
  exportResponses(ctx: any): Promise<any>;
58
58
  reseedDemo(ctx: any): Promise<void>;
59
+ purgeDemo(ctx: any): Promise<void>;
60
+ clearResponses(ctx: any): Promise<any>;
61
+ exportBundle(ctx: any): Promise<any>;
62
+ importBundle(ctx: any): Promise<any>;
59
63
  };
60
64
  'ci-color': ({ strapi }: {
61
65
  strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
@@ -76,6 +76,10 @@ declare const _default: {
76
76
  responses(ctx: any): Promise<void>;
77
77
  exportResponses(ctx: any): Promise<any>;
78
78
  reseedDemo(ctx: any): Promise<void>;
79
+ purgeDemo(ctx: any): Promise<void>;
80
+ clearResponses(ctx: any): Promise<any>;
81
+ exportBundle(ctx: any): Promise<any>;
82
+ importBundle(ctx: any): Promise<any>;
79
83
  };
80
84
  'ci-color': ({ strapi }: {
81
85
  strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
@@ -182,7 +186,11 @@ declare const _default: {
182
186
  isDefault: boolean;
183
187
  }>>;
184
188
  ensureSampleSubmissions(force?: boolean): Promise<void>;
185
- ensureSeeded(): Promise<void>;
189
+ ensureSeeded(force?: boolean): Promise<void>;
190
+ purgeDemoForms(): Promise<{
191
+ deletedForms: number;
192
+ deletedFormSubmissions: number;
193
+ }>;
186
194
  findRawByIdOrSlug(idOrSlug: string | number): Promise<any>;
187
195
  findAllAdmin(): Promise<any[]>;
188
196
  findAllPublic(): Promise<any[]>;
@@ -268,11 +276,19 @@ declare const _default: {
268
276
  'ci-survey': ({ strapi }: {
269
277
  strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
270
278
  }) => {
279
+ deleteResponsesForSurveyRecord(survey: any): Promise<number>;
271
280
  ensureSeeded(forceReseedResponses?: boolean): Promise<void>;
272
281
  reseedSampleData(): Promise<{
273
282
  ok: boolean;
274
283
  totalSurveyResponses: number;
275
284
  }>;
285
+ purgeDemoData(): Promise<{
286
+ ok: boolean;
287
+ deletedSurveys: number;
288
+ deletedSurveyResponses: number;
289
+ deletedForms: number;
290
+ deletedFormSubmissions: number;
291
+ }>;
276
292
  findRawByIdOrSlug(idOrSlug: string | number): Promise<any>;
277
293
  getResponsesForSurvey(survey: any): Promise<any[]>;
278
294
  findAllAdmin(): Promise<any[]>;
@@ -288,6 +304,13 @@ declare const _default: {
288
304
  }): Promise<any>;
289
305
  remove(idOrSlug: string | number): Promise<{
290
306
  success: boolean;
307
+ deletedResponses: number;
308
+ }>;
309
+ clearResponses(idOrSlug: string | number): Promise<{
310
+ ok: boolean;
311
+ slug: any;
312
+ deletedCount: any;
313
+ survey: any;
291
314
  }>;
292
315
  submitSurvey(idOrSlug: string | number, rawBody: Record<string, any>, meta?: {
293
316
  ip?: string;
@@ -330,6 +353,7 @@ declare const _default: {
330
353
  optionsBreakdown: any;
331
354
  average: any;
332
355
  distribution: any;
356
+ scaleLabels: any;
333
357
  npsBreakdown: any;
334
358
  rankingBreakdown: any;
335
359
  }[];
@@ -378,6 +402,7 @@ declare const _default: {
378
402
  optionsBreakdown: any;
379
403
  average: any;
380
404
  distribution: any;
405
+ scaleLabels: any;
381
406
  npsBreakdown: any;
382
407
  rankingBreakdown: any;
383
408
  }[];
@@ -404,6 +429,7 @@ declare const _default: {
404
429
  optionsBreakdown: any;
405
430
  average: any;
406
431
  distribution: any;
432
+ scaleLabels: any;
407
433
  npsBreakdown: any;
408
434
  rankingBreakdown: any;
409
435
  }[];
@@ -465,9 +491,11 @@ declare const _default: {
465
491
  max: number;
466
492
  lowLabel: string | Record<string, string>;
467
493
  highLabel: string | Record<string, string>;
494
+ scaleLabels: Record<string, string | Record<string, string>>;
468
495
  average: number;
469
496
  distribution: {
470
497
  value: number;
498
+ labels: string | Record<string, string>;
471
499
  count: number;
472
500
  percentage: number;
473
501
  }[];
@@ -547,15 +575,41 @@ declare const _default: {
547
575
  }>;
548
576
  listResponses(idOrSlug: string | number, limit?: number): Promise<any>;
549
577
  exportResponses(idOrSlug: string | number, options?: {
550
- format?: "csv" | "json";
578
+ format?: "xlsx" | "csv" | "json";
551
579
  locale?: import('./utils/formValidator').ValidationLocale;
552
580
  from?: string;
553
581
  to?: string;
554
582
  }): Promise<{
583
+ filename: string;
584
+ contentType: string;
585
+ body: Buffer<ArrayBufferLike>;
586
+ } | {
555
587
  filename: string;
556
588
  contentType: string;
557
589
  body: string;
558
590
  }>;
591
+ exportBundle(targetIdOrAll?: string, mode?: "structure" | "full"): Promise<{
592
+ filename: string;
593
+ contentType: string;
594
+ bundle: {
595
+ packageType: string;
596
+ schemaVersion: number;
597
+ mode: "structure" | "full";
598
+ exportedAt: string;
599
+ surveyCount: number;
600
+ totalResponses: number;
601
+ surveys: any[];
602
+ };
603
+ }>;
604
+ importBundle(rawPayload: any, options?: {
605
+ conflictStrategy?: "duplicate" | "overwrite";
606
+ includeResponses?: boolean;
607
+ }): Promise<{
608
+ ok: boolean;
609
+ importedCount: number;
610
+ importedResponsesCount: number;
611
+ importedSurveys: any[];
612
+ }>;
559
613
  };
560
614
  'ci-color': ({ strapi }: {
561
615
  strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
@@ -164,7 +164,11 @@ declare const ciFormService: ({ strapi }: {
164
164
  isDefault: boolean;
165
165
  }>>;
166
166
  ensureSampleSubmissions(force?: boolean): Promise<void>;
167
- ensureSeeded(): Promise<void>;
167
+ ensureSeeded(force?: boolean): Promise<void>;
168
+ purgeDemoForms(): Promise<{
169
+ deletedForms: number;
170
+ deletedFormSubmissions: number;
171
+ }>;
168
172
  findRawByIdOrSlug(idOrSlug: string | number): Promise<any>;
169
173
  findAllAdmin(): Promise<any[]>;
170
174
  findAllPublic(): Promise<any[]>;
@@ -4,11 +4,19 @@ import { CISurveyAnalyticsFilter, CISurveyDefinition } from '../utils/surveyEngi
4
4
  declare const ciSurveyService: ({ strapi }: {
5
5
  strapi: Core.Strapi;
6
6
  }) => {
7
+ deleteResponsesForSurveyRecord(survey: any): Promise<number>;
7
8
  ensureSeeded(forceReseedResponses?: boolean): Promise<void>;
8
9
  reseedSampleData(): Promise<{
9
10
  ok: boolean;
10
11
  totalSurveyResponses: number;
11
12
  }>;
13
+ purgeDemoData(): Promise<{
14
+ ok: boolean;
15
+ deletedSurveys: number;
16
+ deletedSurveyResponses: number;
17
+ deletedForms: number;
18
+ deletedFormSubmissions: number;
19
+ }>;
12
20
  findRawByIdOrSlug(idOrSlug: string | number): Promise<any>;
13
21
  getResponsesForSurvey(survey: any): Promise<any[]>;
14
22
  findAllAdmin(): Promise<any[]>;
@@ -24,6 +32,13 @@ declare const ciSurveyService: ({ strapi }: {
24
32
  }): Promise<any>;
25
33
  remove(idOrSlug: string | number): Promise<{
26
34
  success: boolean;
35
+ deletedResponses: number;
36
+ }>;
37
+ clearResponses(idOrSlug: string | number): Promise<{
38
+ ok: boolean;
39
+ slug: any;
40
+ deletedCount: any;
41
+ survey: any;
27
42
  }>;
28
43
  submitSurvey(idOrSlug: string | number, rawBody: Record<string, any>, meta?: {
29
44
  ip?: string;
@@ -66,6 +81,7 @@ declare const ciSurveyService: ({ strapi }: {
66
81
  optionsBreakdown: any;
67
82
  average: any;
68
83
  distribution: any;
84
+ scaleLabels: any;
69
85
  npsBreakdown: any;
70
86
  rankingBreakdown: any;
71
87
  }[];
@@ -114,6 +130,7 @@ declare const ciSurveyService: ({ strapi }: {
114
130
  optionsBreakdown: any;
115
131
  average: any;
116
132
  distribution: any;
133
+ scaleLabels: any;
117
134
  npsBreakdown: any;
118
135
  rankingBreakdown: any;
119
136
  }[];
@@ -140,6 +157,7 @@ declare const ciSurveyService: ({ strapi }: {
140
157
  optionsBreakdown: any;
141
158
  average: any;
142
159
  distribution: any;
160
+ scaleLabels: any;
143
161
  npsBreakdown: any;
144
162
  rankingBreakdown: any;
145
163
  }[];
@@ -201,9 +219,11 @@ declare const ciSurveyService: ({ strapi }: {
201
219
  max: number;
202
220
  lowLabel: string | Record<string, string>;
203
221
  highLabel: string | Record<string, string>;
222
+ scaleLabels: Record<string, string | Record<string, string>>;
204
223
  average: number;
205
224
  distribution: {
206
225
  value: number;
226
+ labels: string | Record<string, string>;
207
227
  count: number;
208
228
  percentage: number;
209
229
  }[];
@@ -283,14 +303,40 @@ declare const ciSurveyService: ({ strapi }: {
283
303
  }>;
284
304
  listResponses(idOrSlug: string | number, limit?: number): Promise<any>;
285
305
  exportResponses(idOrSlug: string | number, options?: {
286
- format?: "csv" | "json";
306
+ format?: "xlsx" | "csv" | "json";
287
307
  locale?: ValidationLocale;
288
308
  from?: string;
289
309
  to?: string;
290
310
  }): Promise<{
311
+ filename: string;
312
+ contentType: string;
313
+ body: Buffer<ArrayBufferLike>;
314
+ } | {
291
315
  filename: string;
292
316
  contentType: string;
293
317
  body: string;
294
318
  }>;
319
+ exportBundle(targetIdOrAll?: string, mode?: "structure" | "full"): Promise<{
320
+ filename: string;
321
+ contentType: string;
322
+ bundle: {
323
+ packageType: string;
324
+ schemaVersion: number;
325
+ mode: "structure" | "full";
326
+ exportedAt: string;
327
+ surveyCount: number;
328
+ totalResponses: number;
329
+ surveys: any[];
330
+ };
331
+ }>;
332
+ importBundle(rawPayload: any, options?: {
333
+ conflictStrategy?: "duplicate" | "overwrite";
334
+ includeResponses?: boolean;
335
+ }): Promise<{
336
+ ok: boolean;
337
+ importedCount: number;
338
+ importedResponsesCount: number;
339
+ importedSurveys: any[];
340
+ }>;
295
341
  };
296
342
  export default ciSurveyService;
@@ -56,7 +56,11 @@ declare const _default: {
56
56
  isDefault: boolean;
57
57
  }>>;
58
58
  ensureSampleSubmissions(force?: boolean): Promise<void>;
59
- ensureSeeded(): Promise<void>;
59
+ ensureSeeded(force?: boolean): Promise<void>;
60
+ purgeDemoForms(): Promise<{
61
+ deletedForms: number;
62
+ deletedFormSubmissions: number;
63
+ }>;
60
64
  findRawByIdOrSlug(idOrSlug: string | number): Promise<any>;
61
65
  findAllAdmin(): Promise<any[]>;
62
66
  findAllPublic(): Promise<any[]>;
@@ -142,11 +146,19 @@ declare const _default: {
142
146
  'ci-survey': ({ strapi }: {
143
147
  strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
144
148
  }) => {
149
+ deleteResponsesForSurveyRecord(survey: any): Promise<number>;
145
150
  ensureSeeded(forceReseedResponses?: boolean): Promise<void>;
146
151
  reseedSampleData(): Promise<{
147
152
  ok: boolean;
148
153
  totalSurveyResponses: number;
149
154
  }>;
155
+ purgeDemoData(): Promise<{
156
+ ok: boolean;
157
+ deletedSurveys: number;
158
+ deletedSurveyResponses: number;
159
+ deletedForms: number;
160
+ deletedFormSubmissions: number;
161
+ }>;
150
162
  findRawByIdOrSlug(idOrSlug: string | number): Promise<any>;
151
163
  getResponsesForSurvey(survey: any): Promise<any[]>;
152
164
  findAllAdmin(): Promise<any[]>;
@@ -162,6 +174,13 @@ declare const _default: {
162
174
  }): Promise<any>;
163
175
  remove(idOrSlug: string | number): Promise<{
164
176
  success: boolean;
177
+ deletedResponses: number;
178
+ }>;
179
+ clearResponses(idOrSlug: string | number): Promise<{
180
+ ok: boolean;
181
+ slug: any;
182
+ deletedCount: any;
183
+ survey: any;
165
184
  }>;
166
185
  submitSurvey(idOrSlug: string | number, rawBody: Record<string, any>, meta?: {
167
186
  ip?: string;
@@ -204,6 +223,7 @@ declare const _default: {
204
223
  optionsBreakdown: any;
205
224
  average: any;
206
225
  distribution: any;
226
+ scaleLabels: any;
207
227
  npsBreakdown: any;
208
228
  rankingBreakdown: any;
209
229
  }[];
@@ -252,6 +272,7 @@ declare const _default: {
252
272
  optionsBreakdown: any;
253
273
  average: any;
254
274
  distribution: any;
275
+ scaleLabels: any;
255
276
  npsBreakdown: any;
256
277
  rankingBreakdown: any;
257
278
  }[];
@@ -278,6 +299,7 @@ declare const _default: {
278
299
  optionsBreakdown: any;
279
300
  average: any;
280
301
  distribution: any;
302
+ scaleLabels: any;
281
303
  npsBreakdown: any;
282
304
  rankingBreakdown: any;
283
305
  }[];
@@ -339,9 +361,11 @@ declare const _default: {
339
361
  max: number;
340
362
  lowLabel: string | Record<string, string>;
341
363
  highLabel: string | Record<string, string>;
364
+ scaleLabels: Record<string, string | Record<string, string>>;
342
365
  average: number;
343
366
  distribution: {
344
367
  value: number;
368
+ labels: string | Record<string, string>;
345
369
  count: number;
346
370
  percentage: number;
347
371
  }[];
@@ -421,15 +445,41 @@ declare const _default: {
421
445
  }>;
422
446
  listResponses(idOrSlug: string | number, limit?: number): Promise<any>;
423
447
  exportResponses(idOrSlug: string | number, options?: {
424
- format?: "csv" | "json";
448
+ format?: "xlsx" | "csv" | "json";
425
449
  locale?: import('../utils/formValidator').ValidationLocale;
426
450
  from?: string;
427
451
  to?: string;
428
452
  }): Promise<{
453
+ filename: string;
454
+ contentType: string;
455
+ body: Buffer<ArrayBufferLike>;
456
+ } | {
429
457
  filename: string;
430
458
  contentType: string;
431
459
  body: string;
432
460
  }>;
461
+ exportBundle(targetIdOrAll?: string, mode?: "structure" | "full"): Promise<{
462
+ filename: string;
463
+ contentType: string;
464
+ bundle: {
465
+ packageType: string;
466
+ schemaVersion: number;
467
+ mode: "structure" | "full";
468
+ exportedAt: string;
469
+ surveyCount: number;
470
+ totalResponses: number;
471
+ surveys: any[];
472
+ };
473
+ }>;
474
+ importBundle(rawPayload: any, options?: {
475
+ conflictStrategy?: "duplicate" | "overwrite";
476
+ includeResponses?: boolean;
477
+ }): Promise<{
478
+ ok: boolean;
479
+ importedCount: number;
480
+ importedResponsesCount: number;
481
+ importedSurveys: any[];
482
+ }>;
433
483
  };
434
484
  'ci-color': ({ strapi }: {
435
485
  strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
@@ -0,0 +1,14 @@
1
+ export declare const DEMO_SEED_STORE_KEY = "demo_seed_state";
2
+ export interface DemoSeedStateValue {
3
+ cleared: boolean;
4
+ surveysInitialized?: boolean;
5
+ formsInitialized?: boolean;
6
+ updatedAt: string;
7
+ }
8
+ export declare function isDemoSeedDisabledByEnv(): boolean;
9
+ export declare function getDemoSeedState(strapi: any): Promise<DemoSeedStateValue & {
10
+ disabledByEnv: boolean;
11
+ }>;
12
+ export declare function updateDemoSeedState(strapi: any, patch: Partial<Omit<DemoSeedStateValue, 'updatedAt'>>): Promise<DemoSeedStateValue>;
13
+ export declare function isDemoSeedBlocked(strapi: any, domain?: 'surveys' | 'forms'): Promise<boolean>;
14
+ export declare function setDemoSeedCleared(strapi: any, cleared: boolean): Promise<DemoSeedStateValue>;
@@ -41,6 +41,7 @@ export interface CISurveyQuestion {
41
41
  scaleMax?: number;
42
42
  lowLabel?: Record<string, string> | string;
43
43
  highLabel?: Record<string, string> | string;
44
+ scaleLabels?: Record<string, Record<string, string> | string>;
44
45
  options?: CISurveyOption[];
45
46
  matrixRows?: CISurveyOption[];
46
47
  matrixColumns?: CISurveyOption[];
@@ -156,9 +157,11 @@ export declare function computeSurveyAnalytics(survey: CISurveyDefinition, rawRe
156
157
  max: number;
157
158
  lowLabel: string | Record<string, string>;
158
159
  highLabel: string | Record<string, string>;
160
+ scaleLabels: Record<string, string | Record<string, string>>;
159
161
  average: number;
160
162
  distribution: {
161
163
  value: number;
164
+ labels: string | Record<string, string>;
162
165
  count: number;
163
166
  percentage: number;
164
167
  }[];
@@ -245,8 +248,10 @@ export declare function computePublicSurveyResults(survey: CISurveyDefinition, r
245
248
  optionsBreakdown: any;
246
249
  average: any;
247
250
  distribution: any;
251
+ scaleLabels: any;
248
252
  npsBreakdown: any;
249
253
  rankingBreakdown: any;
250
254
  }[];
251
255
  };
252
256
  export declare function exportSurveyResponsesToCsv(survey: CISurveyDefinition, rawResponses: any[], locale?: ValidationLocale): string;
257
+ export declare function exportSurveyResponsesToXlsxBuffer(survey: CISurveyDefinition, rawResponses: any[], locale?: ValidationLocale): Buffer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozguraltan/strapi-content-input",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
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>",