@xuda.io/xuda-widget-plugin-xuda-drive 1.0.5 → 1.0.7

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 +16 -0
  2. package/package.json +1 -1
  3. package/runtime.mjs +9 -3
package/index.mjs CHANGED
@@ -208,6 +208,22 @@ export const methods = {
208
208
  },
209
209
  ],
210
210
  },
211
+ show_toolbar: {
212
+ label: "Show Toolbar",
213
+ type: "string",
214
+ render: "segment",
215
+ tooltip: "",
216
+ options: [
217
+ {
218
+ label: "No",
219
+ value: "",
220
+ },
221
+ {
222
+ label: "Yes",
223
+ value: "yes",
224
+ },
225
+ ],
226
+ },
211
227
  },
212
228
  response: { uploaded_files: "" },
213
229
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-widget-plugin-xuda-drive",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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
@@ -506,6 +506,8 @@ export async function upload(fields, e) {
506
506
  }
507
507
 
508
508
  export async function viewer(fields, e) {
509
+ const { app_id, gtp_token, app_token } = SESSION_OBJ[e.SESSION_ID];
510
+
509
511
  await func.utils.load_js_on_demand(
510
512
  "https://cdn.tailwindcss.com?plugins=forms"
511
513
  );
@@ -528,6 +530,10 @@ export async function viewer(fields, e) {
528
530
  </svg>
529
531
  <span class="sr-only">Use grid view</span>
530
532
  </button>
533
+ <button type="button" class="ml-0.5 rounded-md bg-white p-1.5 text-gray-400 shadow-sm focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
534
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="#000000" viewBox="0 0 256 256"><path d="M200,64V192a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H192A8,8,0,0,1,200,64Z" opacity="0.2"></path><path d="M192,48H64A16,16,0,0,0,48,64V192a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64A16,16,0,0,0,192,48Zm0,144H64V64H192V192ZM240,56V200a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0ZM32,56V200a8,8,0,0,1-16,0V56a8,8,0,0,1,16,0Z"></path></svg>
535
+ <span class="sr-only">Use grid view</span>
536
+ </button>
531
537
  </div>
532
538
  </div>
533
539
 
@@ -557,7 +563,7 @@ export async function viewer(fields, e) {
557
563
 
558
564
  e.$containerP.html(html);
559
565
 
560
- let opt = {};
566
+ let opt = { app_id, type: "file" };
561
567
 
562
568
  try {
563
569
  let domain =
@@ -570,8 +576,8 @@ export async function viewer(fields, e) {
570
576
  headers: {
571
577
  Accept: "application/json",
572
578
  "Content-Type": "application/json",
573
- "xu-gtp-token": e._session.gtp_token,
574
- "xu-app-token": e._session.app_token,
579
+ "xu-gtp-token": gtp_token,
580
+ "xu-app-token": app_token,
575
581
  },
576
582
  body: JSON.stringify(opt),
577
583
  }