@xuda.io/xuda-widget-plugin-xuda-drive 1.0.41 → 1.0.43

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 (3) hide show
  1. package/index.mjs +82 -67
  2. package/package.json +1 -1
  3. package/runtime.mjs +4 -4
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  var common_fields = {
2
2
  file_upload_drop_area_label: {
3
3
  label: "Drop Area Label",
4
- type: "string",
4
+ type: "string"
5
5
  },
6
6
  file_upload_allow_multiple_files: {
7
7
  label: "Allow Multiple Files",
@@ -12,13 +12,13 @@ var common_fields = {
12
12
  options: [
13
13
  {
14
14
  label: "Yes",
15
- value: true,
15
+ value: true
16
16
  },
17
17
  {
18
18
  label: "No",
19
- value: false,
20
- },
21
- ],
19
+ value: false
20
+ }
21
+ ]
22
22
  },
23
23
  file_upload_mime_type_preset: {
24
24
  label: "Mime Type",
@@ -28,26 +28,26 @@ var common_fields = {
28
28
  options: [
29
29
  {
30
30
  label: "Select",
31
- value: "",
31
+ value: ""
32
32
  },
33
33
  {
34
34
  label: "Video",
35
- value: "video",
35
+ value: "video"
36
36
  },
37
37
  {
38
38
  label: "Audio",
39
- value: "audio",
39
+ value: "audio"
40
40
  },
41
41
  {
42
42
  label: "Image",
43
- value: "image",
44
- },
45
- ],
43
+ value: "image"
44
+ }
45
+ ]
46
46
  },
47
47
  file_upload_custom_mime_types: {
48
48
  label: "Custom Mime Types",
49
49
  type: "string",
50
- tooltip: "Separate with commas",
50
+ tooltip: "Separate with commas"
51
51
  },
52
52
  public_file: {
53
53
  label: "Public File",
@@ -58,23 +58,23 @@ var common_fields = {
58
58
  options: [
59
59
  {
60
60
  label: "Yes",
61
- value: true,
61
+ value: true
62
62
  },
63
63
  {
64
64
  label: "No",
65
- value: false,
66
- },
67
- ],
65
+ value: false
66
+ }
67
+ ]
68
68
  },
69
69
  drive_folder: {
70
70
  label: "Drive Folder",
71
- type: "string",
71
+ type: "string"
72
72
  },
73
73
  assign_file_tags: {
74
74
  label: "File Tags",
75
75
  type: "array",
76
76
  tooltip: "",
77
- render: "chips",
77
+ render: "chips"
78
78
  },
79
79
  auto_tag_generator: {
80
80
  label: "Auto Tag Generator",
@@ -85,44 +85,42 @@ var common_fields = {
85
85
  options: [
86
86
  {
87
87
  label: "Yes",
88
- value: true,
88
+ value: true
89
89
  },
90
90
  {
91
91
  label: "No",
92
- value: false,
93
- },
94
- ],
92
+ value: false
93
+ }
94
+ ]
95
95
  },
96
96
  auto_tag_identifier: {
97
97
  label: "Auto Tag Identifier",
98
98
  type: "string",
99
- tooltip:
100
- "A character to use to separate the tags from the filename default '-'",
99
+ tooltip: "A character to use to separate the tags from the filename default '-'"
101
100
  },
102
101
  auto_tag_translation: {
103
102
  label: "Auto Tag Translation",
104
103
  type: "object",
105
104
  tooltip: "Translation is enabled by defining key-value pairs in an object.",
106
105
  render: "editor",
107
- "render_params.language": "json",
106
+ "render_params.language": "json"
108
107
  },
109
108
  custom_tags_parser: {
110
109
  label: "Custom Tags Parser",
111
110
  type: "object",
112
- tooltip:
113
- "Create a custom function to extract the filename and return an array of tags.",
111
+ tooltip: "Create a custom function to extract the filename and return an array of tags.",
114
112
  render: "editor",
115
- "render_params.language": "javascript",
113
+ "render_params.language": "javascript"
116
114
  },
117
115
  event_name_for_successful_callback: {
118
116
  label: "Successful Callback",
119
117
  type: "string",
120
- render: "eventId",
118
+ render: "eventId"
121
119
  },
122
120
  event_name_for_successful_remove_callback: {
123
121
  label: "Successful Remove Callback",
124
122
  type: "string",
125
- render: "eventId",
123
+ render: "eventId"
126
124
  },
127
125
  clear_on_file_upload: {
128
126
  label: "Clear on File Upload",
@@ -133,17 +131,17 @@ var common_fields = {
133
131
  options: [
134
132
  {
135
133
  label: "Yes",
136
- value: true,
134
+ value: true
137
135
  },
138
136
  {
139
137
  label: "No",
140
- value: false,
141
- },
142
- ],
138
+ value: false
139
+ }
140
+ ]
143
141
  },
144
142
  file_upload_folder: {
145
143
  label: "Upload Folder",
146
- type: "string",
144
+ type: "string"
147
145
  },
148
146
  prompt_file_exist: {
149
147
  label: "Prompt file exist",
@@ -154,14 +152,31 @@ var common_fields = {
154
152
  options: [
155
153
  {
156
154
  label: "Yes",
157
- value: true,
155
+ value: true
158
156
  },
159
157
  {
160
158
  label: "No",
161
- value: false,
162
- },
163
- ],
159
+ value: false
160
+ }
161
+ ]
164
162
  },
163
+ direction: {
164
+ label: "Direction",
165
+ type: "string",
166
+ render: "segment",
167
+ tooltip: "",
168
+ defaultValue: () => "ltr",
169
+ options: [
170
+ {
171
+ label: "RTL",
172
+ value: "rtl"
173
+ },
174
+ {
175
+ label: "LTR",
176
+ value: "ltr"
177
+ }
178
+ ]
179
+ }
165
180
  };
166
181
 
167
182
  export const methods = {
@@ -169,7 +184,7 @@ export const methods = {
169
184
  name: "Upload",
170
185
  tooltip: "",
171
186
  fields: common_fields,
172
- response: { uploaded_files: "" },
187
+ response: { uploaded_files: "" }
173
188
  },
174
189
  viewer: {
175
190
  name: "Viewer",
@@ -184,28 +199,28 @@ export const methods = {
184
199
  options: [
185
200
  {
186
201
  label: "Gallery",
187
- value: "gallery",
202
+ value: "gallery"
188
203
  },
189
204
  {
190
205
  label: "List",
191
- value: "list",
206
+ value: "list"
192
207
  },
193
208
  {
194
209
  label: "Slider",
195
- value: "slider",
196
- },
197
- ],
210
+ value: "slider"
211
+ }
212
+ ]
198
213
  },
199
214
 
200
215
  drive_folder: {
201
216
  label: "Drive Folder",
202
- type: "string",
217
+ type: "string"
203
218
  },
204
219
  filter_tags: {
205
220
  label: "Filter Tags",
206
221
  type: "array",
207
222
  tooltip: "",
208
- render: "chips",
223
+ render: "chips"
209
224
  },
210
225
  sort_by: {
211
226
  label: "Sort By",
@@ -216,13 +231,13 @@ export const methods = {
216
231
  options: [
217
232
  {
218
233
  label: "Date",
219
- value: "date",
234
+ value: "date"
220
235
  },
221
236
  {
222
237
  label: "File Name",
223
- value: "name",
224
- },
225
- ],
238
+ value: "name"
239
+ }
240
+ ]
226
241
  },
227
242
  sort_dir: {
228
243
  label: "Sort Direction",
@@ -233,13 +248,13 @@ export const methods = {
233
248
  options: [
234
249
  {
235
250
  label: "Descending",
236
- value: "desc",
251
+ value: "desc"
237
252
  },
238
253
  {
239
254
  label: "Ascending",
240
- value: "asc",
241
- },
242
- ],
255
+ value: "asc"
256
+ }
257
+ ]
243
258
  },
244
259
  show_toolbar: {
245
260
  label: "Show Toolbar",
@@ -250,18 +265,18 @@ export const methods = {
250
265
  options: [
251
266
  {
252
267
  label: "Yes",
253
- value: true,
268
+ value: true
254
269
  },
255
270
  {
256
271
  label: "No",
257
- value: false,
258
- },
259
- ],
272
+ value: false
273
+ }
274
+ ]
260
275
  },
261
276
  toolbar_label: {
262
277
  label: "Toolbar Label",
263
278
  type: "string",
264
- tooltip: "",
279
+ tooltip: ""
265
280
  },
266
281
  show_upload_button: {
267
282
  label: "Show Upload Button",
@@ -272,16 +287,16 @@ export const methods = {
272
287
  options: [
273
288
  {
274
289
  label: "Yes",
275
- value: true,
290
+ value: true
276
291
  },
277
292
  {
278
293
  label: "No",
279
- value: false,
280
- },
281
- ],
294
+ value: false
295
+ }
296
+ ]
282
297
  },
283
- ...common_fields,
298
+ ...common_fields
284
299
  },
285
- response: { uploaded_files: "" },
286
- },
300
+ response: { uploaded_files: "" }
301
+ }
287
302
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-widget-plugin-xuda-drive",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Xuda Drive widget plugin",
5
5
  "scripts": {
6
6
  "pub": "npm version patch --force && npm publish --access public"
package/runtime.mjs CHANGED
@@ -594,7 +594,7 @@ export async function viewer(fields, e) {
594
594
 
595
595
  <!-- Tabs -->
596
596
  <div ref="dropZoneRef" class="flex-1 overflow-auto size-full relative">
597
- <div v-if="isOverDropZone" class="absolute inset-0 z-10 px-2 py-2 animate">
597
+ <div v-if="isOverDropZone && view !== 'slider'" class="absolute inset-0 z-10 px-2 py-2 animate">
598
598
  <div class="size-full flex flex-col justify-between items-center !border-black border-2 rounded-2xl bg-black/20">
599
599
  <div></div>
600
600
 
@@ -680,7 +680,7 @@ export async function viewer(fields, e) {
680
680
  </button>
681
681
  </div>
682
682
 
683
- <div class="swiper-container flex-1 w-full h-full" ref="swiper-container">
683
+ <div class="swiper-container flex-1 w-full h-full" dir="rtl" ref="swiper-container">
684
684
  <div class="swiper-wrapper">
685
685
  <!-- Slides -->
686
686
  <template v-for="file in files" hidden>
@@ -1099,7 +1099,7 @@ export async function viewer(fields, e) {
1099
1099
  },
1100
1100
  mounted() {
1101
1101
  var onDrop = (files) => {
1102
- if (this.view === "swiper") return;
1102
+ if (this.view === "slider") return;
1103
1103
  this.uploadModal = true;
1104
1104
  this.pond.addFiles(files);
1105
1105
  };
@@ -1162,7 +1162,7 @@ export async function viewer(fields, e) {
1162
1162
  spaceBetween: 20,
1163
1163
  observer: true,
1164
1164
  observeParents: true,
1165
- paginationClickable: true
1165
+ ...(fields?.direction === "rtl" ? { reverseDirection: true } : {})
1166
1166
  });
1167
1167
 
1168
1168
  this.swiper.on("slideChange", (event) => {