@adminforth/upload 1.4.2 → 1.4.4
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/build.log +1 -1
- package/dist/index.js +12 -9
- package/index.ts +11 -8
- package/package.json +1 -1
- package/types.ts +9 -0
package/build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -99,7 +99,7 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
|
|
|
99
99
|
modifyResourceConfig: { get: () => super.modifyResourceConfig }
|
|
100
100
|
});
|
|
101
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
102
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
103
103
|
_super.modifyResourceConfig.call(this, adminforth, resourceConfig);
|
|
104
104
|
// after column to store the path of the uploaded file, add new VirtualColumn,
|
|
105
105
|
// show only in edit and create views
|
|
@@ -162,14 +162,16 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
|
|
|
162
162
|
}
|
|
163
163
|
const pathColumn = resourceConfig.columns[pathColumnIndex];
|
|
164
164
|
// add preview column to list
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
if (((_l = this.options.preview) === null || _l === void 0 ? void 0 : _l.usePreviewComponents) !== false) {
|
|
166
|
+
resourceConfig.columns[pathColumnIndex].components.list = {
|
|
167
|
+
file: this.componentPath('preview.vue'),
|
|
168
|
+
meta: pluginFrontendOptions,
|
|
169
|
+
};
|
|
170
|
+
resourceConfig.columns[pathColumnIndex].components.show = {
|
|
171
|
+
file: this.componentPath('preview.vue'),
|
|
172
|
+
meta: pluginFrontendOptions,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
173
175
|
// insert virtual column after path column if it is not already there
|
|
174
176
|
const virtualColumnIndex = resourceConfig.columns.findIndex((column) => column.name === virtualColumn.name);
|
|
175
177
|
if (virtualColumnIndex === -1) {
|
|
@@ -469,6 +471,7 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
|
|
|
469
471
|
prompt,
|
|
470
472
|
inputFiles: attachmentFiles,
|
|
471
473
|
n: 1,
|
|
474
|
+
size: this.options.generation.outputSize,
|
|
472
475
|
});
|
|
473
476
|
if (resp.error) {
|
|
474
477
|
console.error('Error generating image', resp.error);
|
package/index.ts
CHANGED
|
@@ -165,15 +165,17 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
|
|
|
165
165
|
const pathColumn = resourceConfig.columns[pathColumnIndex];
|
|
166
166
|
|
|
167
167
|
// add preview column to list
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
if (this.options.preview?.usePreviewComponents !== false) {
|
|
169
|
+
resourceConfig.columns[pathColumnIndex].components.list = {
|
|
170
|
+
file: this.componentPath('preview.vue'),
|
|
171
|
+
meta: pluginFrontendOptions,
|
|
172
|
+
};
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
resourceConfig.columns[pathColumnIndex].components.show = {
|
|
175
|
+
file: this.componentPath('preview.vue'),
|
|
176
|
+
meta: pluginFrontendOptions,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
177
179
|
|
|
178
180
|
// insert virtual column after path column if it is not already there
|
|
179
181
|
const virtualColumnIndex = resourceConfig.columns.findIndex((column: any) => column.name === virtualColumn.name);
|
|
@@ -531,6 +533,7 @@ getBucketLifecycleConfiguration on bucket ${this.options.s3Bucket} in region ${t
|
|
|
531
533
|
prompt,
|
|
532
534
|
inputFiles: attachmentFiles,
|
|
533
535
|
n: 1,
|
|
536
|
+
size: this.options.generation.outputSize,
|
|
534
537
|
}
|
|
535
538
|
)
|
|
536
539
|
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -65,6 +65,11 @@ export type PluginOptions = {
|
|
|
65
65
|
|
|
66
66
|
preview?: {
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Whether to use preview components provided by the plugin. BY default true
|
|
70
|
+
*/
|
|
71
|
+
usePreviewComponents?: boolean,
|
|
72
|
+
|
|
68
73
|
/**
|
|
69
74
|
* Maximum width of the preview image
|
|
70
75
|
*/
|
|
@@ -118,6 +123,10 @@ export type PluginOptions = {
|
|
|
118
123
|
generation?: {
|
|
119
124
|
adapter: ImageGenerationAdapter,
|
|
120
125
|
|
|
126
|
+
/**
|
|
127
|
+
* The size of the generated image.
|
|
128
|
+
*/
|
|
129
|
+
outputSize?: string,
|
|
121
130
|
|
|
122
131
|
/**
|
|
123
132
|
* Fields for conetext which will be used to generate the image.
|