@ozguraltan/strapi-content-input 1.0.21 → 1.0.23
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 +42 -13
- package/dist/admin/{AnalyticsHubPage-DsrcGI_Y.mjs → AnalyticsHubPage-Dvpx3KsP.mjs} +168 -55
- package/dist/admin/{AnalyticsHubPage-0p0Mx4AU.js → AnalyticsHubPage-K_trli5i.js} +186 -55
- package/dist/admin/{ContentInputField-CHXrzvE-.mjs → ContentInputField-C2kmtUwD.mjs} +328 -366
- package/dist/admin/{ContentInputField-7rWLSx_7.js → ContentInputField-CjxYYEps.js} +343 -381
- package/dist/admin/{SurveyWidgetEditor-BVN6X_3G.mjs → SurveyWidgetEditor-DMWOkHUt.mjs} +3271 -227
- package/dist/admin/{SurveyWidgetEditor-BmgYQaQS.js → SurveyWidgetEditor-DOYxWop9.js} +3247 -203
- package/dist/admin/{index-hFIuYqu5.mjs → index-AePRA0IB.mjs} +2 -2
- package/dist/admin/{index-CZAwXCFH.js → index-B9C8Qrfd.js} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/common/CIImageSettingsControl.d.ts +17 -0
- package/dist/admin/src/components/widgets/CustomCardWidgetEditor.d.ts +1 -0
- package/dist/admin/src/components/widgets/HeroSliderStage.d.ts +3 -0
- package/dist/admin/src/components/widgets/SurveyLivePreviewPane.d.ts +9 -0
- package/dist/admin/src/components/widgets/SurveyWidgetEditor.d.ts +3 -1
- package/dist/admin/src/core/canvasClasses.d.ts +1 -0
- package/dist/admin/src/core/types.d.ts +12 -0
- package/dist/server/index.js +1359 -196
- package/dist/server/index.mjs +1341 -196
- package/dist/server/src/config/index.d.ts +4 -0
- package/dist/server/src/controllers/ci-image.d.ts +11 -2
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/index.d.ts +15 -1
- package/dist/server/src/services/ci-survey.d.ts +10 -1
- package/dist/server/src/services/index.d.ts +10 -1
- package/dist/server/src/utils/image-variants.d.ts +74 -0
- package/dist/server/src/utils/surveyEngine.d.ts +5 -0
- package/package.json +1 -1
|
@@ -4,13 +4,22 @@ declare const ciImageController: ({ strapi }: {
|
|
|
4
4
|
}) => {
|
|
5
5
|
/**
|
|
6
6
|
* GET /api/content-input/image & GET /content-input/image
|
|
7
|
-
*
|
|
7
|
+
* Generates `ci-optimized` WebP variants via sharp, uploads to Strapi's Upload Provider (CDN),
|
|
8
|
+
* persists in `plugin::upload.file.formats`, and issues a 302 redirect when a remote CDN URL is available
|
|
9
|
+
* (with local byte-stream fallback in local-only environments).
|
|
8
10
|
*/
|
|
9
11
|
processImage(ctx: any): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* POST /content-input/media/optimize
|
|
14
|
+
* Eagerly optimizes one or multiple selected/uploaded Media Library assets into `ci-optimized/*.webp`
|
|
15
|
+
* on the configured Upload Provider (CDN) and returns enriched CIMediaAsset object(s) with `formats` & `optimized_url`.
|
|
16
|
+
*/
|
|
17
|
+
optimizeMedia(ctx: any): Promise<any>;
|
|
10
18
|
/**
|
|
11
19
|
* POST /content-input/media/crop
|
|
12
20
|
* Interactive crop & rotate using sharp on the backend (works seamlessly with local disk AND remote CDNs).
|
|
13
|
-
* Supports mode: 'replace' (crops original asset in Media Library
|
|
21
|
+
* Supports mode: 'replace' (crops original asset in Media Library & refreshes ci-optimized variants)
|
|
22
|
+
* or 'duplicate' (saves as new asset).
|
|
14
23
|
*/
|
|
15
24
|
cropMedia(ctx: any): Promise<any>;
|
|
16
25
|
/**
|
|
@@ -20,6 +20,7 @@ declare const _default: {
|
|
|
20
20
|
strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
|
|
21
21
|
}) => {
|
|
22
22
|
processImage(ctx: any): Promise<any>;
|
|
23
|
+
optimizeMedia(ctx: any): Promise<any>;
|
|
23
24
|
cropMedia(ctx: any): Promise<any>;
|
|
24
25
|
updateMediaInfo(ctx: any): Promise<any>;
|
|
25
26
|
deleteMedia(ctx: any): Promise<any>;
|
|
@@ -11,6 +11,10 @@ declare const _default: {
|
|
|
11
11
|
config: {
|
|
12
12
|
default: {
|
|
13
13
|
previewUrl: string;
|
|
14
|
+
imageVariantFolder: string;
|
|
15
|
+
imageVariantFormat: string;
|
|
16
|
+
imageVariantQuality: number;
|
|
17
|
+
redirectProxyToCdn: boolean;
|
|
14
18
|
};
|
|
15
19
|
validator(): void;
|
|
16
20
|
};
|
|
@@ -36,6 +40,7 @@ declare const _default: {
|
|
|
36
40
|
strapi: import('@strapi/types/dist/core/strapi.js').Strapi;
|
|
37
41
|
}) => {
|
|
38
42
|
processImage(ctx: any): Promise<any>;
|
|
43
|
+
optimizeMedia(ctx: any): Promise<any>;
|
|
39
44
|
cropMedia(ctx: any): Promise<any>;
|
|
40
45
|
updateMediaInfo(ctx: any): Promise<any>;
|
|
41
46
|
deleteMedia(ctx: any): Promise<any>;
|
|
@@ -325,6 +330,7 @@ declare const _default: {
|
|
|
325
330
|
optionsBreakdown: any;
|
|
326
331
|
average: any;
|
|
327
332
|
distribution: any;
|
|
333
|
+
scaleLabels: any;
|
|
328
334
|
npsBreakdown: any;
|
|
329
335
|
rankingBreakdown: any;
|
|
330
336
|
}[];
|
|
@@ -373,6 +379,7 @@ declare const _default: {
|
|
|
373
379
|
optionsBreakdown: any;
|
|
374
380
|
average: any;
|
|
375
381
|
distribution: any;
|
|
382
|
+
scaleLabels: any;
|
|
376
383
|
npsBreakdown: any;
|
|
377
384
|
rankingBreakdown: any;
|
|
378
385
|
}[];
|
|
@@ -399,6 +406,7 @@ declare const _default: {
|
|
|
399
406
|
optionsBreakdown: any;
|
|
400
407
|
average: any;
|
|
401
408
|
distribution: any;
|
|
409
|
+
scaleLabels: any;
|
|
402
410
|
npsBreakdown: any;
|
|
403
411
|
rankingBreakdown: any;
|
|
404
412
|
}[];
|
|
@@ -460,9 +468,11 @@ declare const _default: {
|
|
|
460
468
|
max: number;
|
|
461
469
|
lowLabel: string | Record<string, string>;
|
|
462
470
|
highLabel: string | Record<string, string>;
|
|
471
|
+
scaleLabels: Record<string, string | Record<string, string>>;
|
|
463
472
|
average: number;
|
|
464
473
|
distribution: {
|
|
465
474
|
value: number;
|
|
475
|
+
labels: string | Record<string, string>;
|
|
466
476
|
count: number;
|
|
467
477
|
percentage: number;
|
|
468
478
|
}[];
|
|
@@ -542,11 +552,15 @@ declare const _default: {
|
|
|
542
552
|
}>;
|
|
543
553
|
listResponses(idOrSlug: string | number, limit?: number): Promise<any>;
|
|
544
554
|
exportResponses(idOrSlug: string | number, options?: {
|
|
545
|
-
format?: "csv" | "json";
|
|
555
|
+
format?: "xlsx" | "csv" | "json";
|
|
546
556
|
locale?: import('./utils/formValidator').ValidationLocale;
|
|
547
557
|
from?: string;
|
|
548
558
|
to?: string;
|
|
549
559
|
}): Promise<{
|
|
560
|
+
filename: string;
|
|
561
|
+
contentType: string;
|
|
562
|
+
body: Buffer<ArrayBufferLike>;
|
|
563
|
+
} | {
|
|
550
564
|
filename: string;
|
|
551
565
|
contentType: string;
|
|
552
566
|
body: string;
|
|
@@ -66,6 +66,7 @@ declare const ciSurveyService: ({ strapi }: {
|
|
|
66
66
|
optionsBreakdown: any;
|
|
67
67
|
average: any;
|
|
68
68
|
distribution: any;
|
|
69
|
+
scaleLabels: any;
|
|
69
70
|
npsBreakdown: any;
|
|
70
71
|
rankingBreakdown: any;
|
|
71
72
|
}[];
|
|
@@ -114,6 +115,7 @@ declare const ciSurveyService: ({ strapi }: {
|
|
|
114
115
|
optionsBreakdown: any;
|
|
115
116
|
average: any;
|
|
116
117
|
distribution: any;
|
|
118
|
+
scaleLabels: any;
|
|
117
119
|
npsBreakdown: any;
|
|
118
120
|
rankingBreakdown: any;
|
|
119
121
|
}[];
|
|
@@ -140,6 +142,7 @@ declare const ciSurveyService: ({ strapi }: {
|
|
|
140
142
|
optionsBreakdown: any;
|
|
141
143
|
average: any;
|
|
142
144
|
distribution: any;
|
|
145
|
+
scaleLabels: any;
|
|
143
146
|
npsBreakdown: any;
|
|
144
147
|
rankingBreakdown: any;
|
|
145
148
|
}[];
|
|
@@ -201,9 +204,11 @@ declare const ciSurveyService: ({ strapi }: {
|
|
|
201
204
|
max: number;
|
|
202
205
|
lowLabel: string | Record<string, string>;
|
|
203
206
|
highLabel: string | Record<string, string>;
|
|
207
|
+
scaleLabels: Record<string, string | Record<string, string>>;
|
|
204
208
|
average: number;
|
|
205
209
|
distribution: {
|
|
206
210
|
value: number;
|
|
211
|
+
labels: string | Record<string, string>;
|
|
207
212
|
count: number;
|
|
208
213
|
percentage: number;
|
|
209
214
|
}[];
|
|
@@ -283,11 +288,15 @@ declare const ciSurveyService: ({ strapi }: {
|
|
|
283
288
|
}>;
|
|
284
289
|
listResponses(idOrSlug: string | number, limit?: number): Promise<any>;
|
|
285
290
|
exportResponses(idOrSlug: string | number, options?: {
|
|
286
|
-
format?: "csv" | "json";
|
|
291
|
+
format?: "xlsx" | "csv" | "json";
|
|
287
292
|
locale?: ValidationLocale;
|
|
288
293
|
from?: string;
|
|
289
294
|
to?: string;
|
|
290
295
|
}): Promise<{
|
|
296
|
+
filename: string;
|
|
297
|
+
contentType: string;
|
|
298
|
+
body: Buffer<ArrayBufferLike>;
|
|
299
|
+
} | {
|
|
291
300
|
filename: string;
|
|
292
301
|
contentType: string;
|
|
293
302
|
body: string;
|
|
@@ -204,6 +204,7 @@ declare const _default: {
|
|
|
204
204
|
optionsBreakdown: any;
|
|
205
205
|
average: any;
|
|
206
206
|
distribution: any;
|
|
207
|
+
scaleLabels: any;
|
|
207
208
|
npsBreakdown: any;
|
|
208
209
|
rankingBreakdown: any;
|
|
209
210
|
}[];
|
|
@@ -252,6 +253,7 @@ declare const _default: {
|
|
|
252
253
|
optionsBreakdown: any;
|
|
253
254
|
average: any;
|
|
254
255
|
distribution: any;
|
|
256
|
+
scaleLabels: any;
|
|
255
257
|
npsBreakdown: any;
|
|
256
258
|
rankingBreakdown: any;
|
|
257
259
|
}[];
|
|
@@ -278,6 +280,7 @@ declare const _default: {
|
|
|
278
280
|
optionsBreakdown: any;
|
|
279
281
|
average: any;
|
|
280
282
|
distribution: any;
|
|
283
|
+
scaleLabels: any;
|
|
281
284
|
npsBreakdown: any;
|
|
282
285
|
rankingBreakdown: any;
|
|
283
286
|
}[];
|
|
@@ -339,9 +342,11 @@ declare const _default: {
|
|
|
339
342
|
max: number;
|
|
340
343
|
lowLabel: string | Record<string, string>;
|
|
341
344
|
highLabel: string | Record<string, string>;
|
|
345
|
+
scaleLabels: Record<string, string | Record<string, string>>;
|
|
342
346
|
average: number;
|
|
343
347
|
distribution: {
|
|
344
348
|
value: number;
|
|
349
|
+
labels: string | Record<string, string>;
|
|
345
350
|
count: number;
|
|
346
351
|
percentage: number;
|
|
347
352
|
}[];
|
|
@@ -421,11 +426,15 @@ declare const _default: {
|
|
|
421
426
|
}>;
|
|
422
427
|
listResponses(idOrSlug: string | number, limit?: number): Promise<any>;
|
|
423
428
|
exportResponses(idOrSlug: string | number, options?: {
|
|
424
|
-
format?: "csv" | "json";
|
|
429
|
+
format?: "xlsx" | "csv" | "json";
|
|
425
430
|
locale?: import('../utils/formValidator').ValidationLocale;
|
|
426
431
|
from?: string;
|
|
427
432
|
to?: string;
|
|
428
433
|
}): Promise<{
|
|
434
|
+
filename: string;
|
|
435
|
+
contentType: string;
|
|
436
|
+
body: Buffer<ArrayBufferLike>;
|
|
437
|
+
} | {
|
|
429
438
|
filename: string;
|
|
430
439
|
contentType: string;
|
|
431
440
|
body: string;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Core } from '@strapi/strapi';
|
|
2
|
+
export interface VariantRuntimeConfig {
|
|
3
|
+
folder: string | null;
|
|
4
|
+
defaultFormat: 'webp' | 'auto';
|
|
5
|
+
redirectProxyToCdn: boolean;
|
|
6
|
+
defaultQuality: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ImageProcessSpec {
|
|
9
|
+
processMode: 'fit' | 'widen' | 'auto' | 'none';
|
|
10
|
+
w: number;
|
|
11
|
+
h: number;
|
|
12
|
+
maxW: number;
|
|
13
|
+
q: number;
|
|
14
|
+
rotate: number;
|
|
15
|
+
requestedFormat?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function getSharp(): any;
|
|
18
|
+
export declare function getVariantConfig(strapi: Core.Strapi): VariantRuntimeConfig;
|
|
19
|
+
export declare function isAbsoluteHttpUrl(url?: string | null): boolean;
|
|
20
|
+
export declare function isOptimizableRasterImage(mime?: string | null, urlOrName?: string | null): boolean;
|
|
21
|
+
export declare function loadSourceBuffer(strapi: Core.Strapi, src: string): Promise<{
|
|
22
|
+
buffer: Buffer;
|
|
23
|
+
mime: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function normalizeImageProcessSpec(imageSettings?: Record<string, any> | null, defaultAutoMaxW?: number): ImageProcessSpec;
|
|
26
|
+
export declare function computeCiFormatKey(processMode: 'fit' | 'widen' | 'auto', w: number, h: number, rotate?: number): string;
|
|
27
|
+
export declare function compactAssetFormats(formats?: Record<string, any> | null): Record<string, {
|
|
28
|
+
url: string;
|
|
29
|
+
width?: number;
|
|
30
|
+
height?: number;
|
|
31
|
+
mime?: string;
|
|
32
|
+
size?: number;
|
|
33
|
+
}> | undefined;
|
|
34
|
+
export declare function findUploadFileForAsset(strapi: Core.Strapi, assetOrUrl: any, cache?: Map<string, any>): Promise<any | null>;
|
|
35
|
+
export declare function renderSharpVariantBuffer(sourceBuffer: Buffer, sourceMime: string, opts: {
|
|
36
|
+
processMode: 'fit' | 'widen' | 'auto';
|
|
37
|
+
w: number;
|
|
38
|
+
h: number;
|
|
39
|
+
q: number;
|
|
40
|
+
rotate?: number;
|
|
41
|
+
cx?: number;
|
|
42
|
+
cy?: number;
|
|
43
|
+
cw?: number;
|
|
44
|
+
ch?: number;
|
|
45
|
+
requestedFormat?: string;
|
|
46
|
+
defaultFormat?: 'webp' | 'auto';
|
|
47
|
+
}): Promise<{
|
|
48
|
+
buffer: Buffer;
|
|
49
|
+
contentType: string;
|
|
50
|
+
ext: string;
|
|
51
|
+
width?: number;
|
|
52
|
+
height?: number;
|
|
53
|
+
}>;
|
|
54
|
+
export declare function ensureMediaVariant(strapi: Core.Strapi, existingFile: any, spec: {
|
|
55
|
+
processMode: 'fit' | 'widen' | 'auto';
|
|
56
|
+
w: number;
|
|
57
|
+
h: number;
|
|
58
|
+
q?: number;
|
|
59
|
+
rotate?: number;
|
|
60
|
+
requestedFormat?: string;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
formatKey: string;
|
|
63
|
+
formatEntry: any | null;
|
|
64
|
+
updatedFile: any;
|
|
65
|
+
}>;
|
|
66
|
+
export declare function clearGeneratedCiVariantsForFile(strapi: Core.Strapi, fileRecord: any): Promise<void>;
|
|
67
|
+
export declare function enrichMediaAssetNode(strapi: Core.Strapi, asset: any, opts?: {
|
|
68
|
+
imageSettings?: Record<string, any> | null;
|
|
69
|
+
defaultAutoMaxW?: number;
|
|
70
|
+
alsoEnsureAutoMaxW?: number;
|
|
71
|
+
fileCache?: Map<string, any>;
|
|
72
|
+
}): Promise<any>;
|
|
73
|
+
export declare function syncContentInputTreeMedia(strapi: Core.Strapi, rawValue: any): Promise<any>;
|
|
74
|
+
export declare function syncSurveyQuestionsMedia(strapi: Core.Strapi, questions: any[]): Promise<any[]>;
|
|
@@ -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.
|
|
3
|
+
"version": "1.0.23",
|
|
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>",
|