@xuda.io/xuda-widget-plugin-xuda-drive 1.0.113 → 1.0.115

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.
@@ -0,0 +1,173 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>AG Grid Plugin Tester</title>
7
+
8
+ <script src="https://master.xuda.io/dist/runtime/js/xuda-runtime-slim.js"></script>
9
+
10
+ <style>
11
+ html,
12
+ body {
13
+ height: 100%;
14
+ width: 100%;
15
+ }
16
+ </style>
17
+
18
+ <link rel="stylesheet" href="./style.css" />
19
+ </head>
20
+
21
+ <body>
22
+ <div id="tester"></div>
23
+
24
+ <script type="module">
25
+ import * as plugin from '../src/runtime.mjs';
26
+
27
+ var xu = new xuda($('#tester')[0], { domain: 'master.xuda.io' });
28
+
29
+ setTimeout(() => {
30
+ const SESSION_ID = Object.keys(SESSION_OBJ)[0];
31
+ var _session = {
32
+ ...SESSION_OBJ[SESSION_ID],
33
+ prog_id: '5b1_cmp_189d0a5c99e2',
34
+ api_key: 'pk_e3c62dd6084d61dde054eb9ddb21bd21',
35
+ DS_GLB: {
36
+ 1: { prog_id: '5b1_cmp_189d0a5c99e2', rows_found: 0, data_feed: { rows: [] } },
37
+ },
38
+ };
39
+
40
+ const e = {
41
+ SESSION_ID,
42
+ $containerP: $('#embed_' + SESSION_ID),
43
+ dsP: 1,
44
+ plugin_name: '@xuda.io/xuda-widget-plugin-xuda-drive',
45
+ _session,
46
+ SESSION_OBJ,
47
+ };
48
+
49
+ // DOCS_OBJ[e._session.app_id] = {
50
+ // [e._session.prog_id]: {
51
+ // properties: {},
52
+ // progFields: [
53
+ // {
54
+ // id: 794069381620,
55
+ // data: {
56
+ // type: 'table',
57
+ // field_id: 'PG_Id',
58
+ // },
59
+ // props: {
60
+ // fieldType: 'string',
61
+ // propExpressions: {},
62
+ // },
63
+ // triggers: [],
64
+ // },
65
+ // {
66
+ // id: 1709807321408,
67
+ // data: {
68
+ // type: 'table',
69
+ // field_id: 'PG_BK_Id',
70
+ // },
71
+ // props: {
72
+ // fieldType: 'string',
73
+ // propExpressions: {},
74
+ // },
75
+ // widget_props: {
76
+ // '@xuda.io/xuda-widget-plugin-xuda-drive': {
77
+ // // label: 'Book Id',
78
+ // // toolTip: 'Just a tooltip',
79
+ // // resizable: false,
80
+ // // align: 'center',
81
+ // // editable: false,
82
+ // // filter: false,
83
+ // // width: 500,
84
+ // // cellStyle: { color: 'red' },
85
+ // // panelProgIdRender: 0,
86
+ // // panelProgIdEditor: 0,
87
+ // // sumType: '',
88
+ // // fieldInputMask: '',
89
+ // },
90
+ // },
91
+ // triggers: [],
92
+ // },
93
+ // {
94
+ // id: 554148618186,
95
+ // data: {
96
+ // type: 'table',
97
+ // field_id: 'PG_Page_Number',
98
+ // },
99
+ // props: {
100
+ // fieldType: 'string',
101
+ // propExpressions: {},
102
+ // },
103
+ // triggers: [],
104
+ // },
105
+ // {
106
+ // id: 301312119484,
107
+ // data: {
108
+ // type: 'table',
109
+ // field_id: 'PG_Hebrew_Page_Number',
110
+ // },
111
+ // props: {
112
+ // fieldType: 'string',
113
+ // propExpressions: {},
114
+ // },
115
+ // triggers: [],
116
+ // },
117
+ // {
118
+ // id: 11645998971,
119
+ // data: {
120
+ // type: 'table',
121
+ // field_id: 'PG_Chapter',
122
+ // },
123
+ // props: {
124
+ // fieldType: 'string',
125
+ // propExpressions: {},
126
+ // },
127
+ // triggers: [],
128
+ // },
129
+ // {
130
+ // id: 1474487142006,
131
+ // data: {
132
+ // type: 'table',
133
+ // field_id: 'PG_Base_Url',
134
+ // },
135
+ // props: {
136
+ // fieldType: 'string',
137
+ // propExpressions: {},
138
+ // },
139
+ // triggers: [],
140
+ // },
141
+ // {
142
+ // id: 212494573220,
143
+ // data: {
144
+ // type: 'table',
145
+ // field_id: 'PG_PR_Id',
146
+ // },
147
+ // props: {
148
+ // fieldType: 'number',
149
+ // propExpressions: {},
150
+ // },
151
+ // triggers: [],
152
+ // },
153
+ // {
154
+ // id: 873998420050,
155
+ // data: {
156
+ // type: 'table',
157
+ // field_id: 'PG_Chapter_Name',
158
+ // },
159
+ // props: {
160
+ // fieldType: 'string',
161
+ // propExpressions: {},
162
+ // },
163
+ // triggers: [],
164
+ // },
165
+ // ],
166
+ // },
167
+ // };
168
+
169
+ plugin.viewer({}, e);
170
+ }, 2000);
171
+ </script>
172
+ </body>
173
+ </html>
package/vite.config.js CHANGED
@@ -1,44 +1,53 @@
1
- import { resolve } from "path";
2
- import { cpSync } from "fs";
1
+ import { splitVendorChunkPlugin } from 'vite';
2
+ import { resolve, basename } from 'path';
3
+
4
+ import { cpSync } from 'fs';
3
5
 
4
6
  export default {
7
+ server: {
8
+ port: 2111,
9
+ },
10
+ root: './tests',
5
11
  build: {
6
12
  lib: {
7
- entry: "src/runtime.mjs",
8
- formats: ["es"],
9
- fileName: (format, entryName) => `${entryName}.mjs`
13
+ entry: 'src/runtime.mjs',
14
+ formats: ['es'],
15
+ fileName: (format, entryName) => `${entryName}.mjs`,
10
16
  },
11
17
  rollupOptions: {
12
- input: "src/runtime.mjs",
18
+ input: 'src/runtime.mjs',
13
19
  output: [
14
20
  {
15
- dir: "dist",
16
- format: "es",
17
- exports: "named",
18
- entryFileNames: "[name].mjs",
19
- name: "MyLibrary",
21
+ dir: 'dist',
22
+ format: 'es',
23
+ exports: 'named',
24
+ entryFileNames: '[name].mjs',
25
+ name: 'MyLibrary',
20
26
  inlineDynamicImports: true,
21
27
 
22
28
  assetFileNames: (assetInfo) => {
23
- if (assetInfo.name && assetInfo.name.endsWith(".css")) {
24
- return "runtime[extname]";
29
+ if (assetInfo.name && assetInfo.name.endsWith('.css')) {
30
+ return 'runtime[extname]';
25
31
  }
26
- return "[name]-[hash][extname]";
27
- }
28
- }
29
- ]
32
+ return '[name]-[hash][extname]';
33
+ },
34
+ },
35
+ ],
30
36
  },
31
- emptyOutDir: true
37
+ emptyOutDir: true,
32
38
  },
33
39
  plugins: [
34
40
  {
35
- name: "copy-index-file",
41
+ name: 'copy-index-file',
36
42
  writeBundle() {
37
- cpSync(resolve(__dirname, "src"), resolve("dist"), { recursive: true, filter: (srcPath) => !srcPath.endsWith("runtime.mjs") && !srcPath.endsWith("vendors") });
38
- }
39
- }
43
+ cpSync(resolve(__dirname, 'src'), resolve('dist'), {
44
+ recursive: true,
45
+ filter: (srcPath) => !srcPath.endsWith('runtime.mjs'),
46
+ });
47
+ },
48
+ },
40
49
  ],
41
50
  define: {
42
- "process.env": process.env
43
- }
51
+ 'process.env': process.env,
52
+ },
44
53
  };
package/dist/index.mjs DELETED
@@ -1,345 +0,0 @@
1
- var common_fields = {
2
- file_upload_drop_area_label: {
3
- label: "Drop Area Label",
4
- type: "string",
5
- },
6
- file_upload_allow_multiple_files: {
7
- label: "Allow Multiple Files",
8
- type: "boolean",
9
- render: "segment",
10
- tooltip: "",
11
- defaultValue: () => false,
12
- options: [
13
- {
14
- label: "Yes",
15
- value: true,
16
- },
17
- {
18
- label: "No",
19
- value: false,
20
- },
21
- ],
22
- },
23
- file_upload_mime_type_preset: {
24
- label: "Mime Type",
25
- type: "string",
26
- render: "select",
27
- tooltip: "",
28
- options: [
29
- {
30
- label: "Select",
31
- value: "",
32
- },
33
- {
34
- label: "Video",
35
- value: "video",
36
- },
37
- {
38
- label: "Audio",
39
- value: "audio",
40
- },
41
- {
42
- label: "Image",
43
- value: "image",
44
- },
45
- ],
46
- },
47
- file_upload_custom_mime_types: {
48
- label: "Custom Mime Types",
49
- type: "string",
50
- tooltip: "Separate with commas",
51
- },
52
- public_file: {
53
- label: "Public File",
54
- type: "boolean",
55
- render: "segment",
56
- tooltip: "",
57
- defaultValue: () => false,
58
- options: [
59
- {
60
- label: "Yes",
61
- value: true,
62
- },
63
- {
64
- label: "No",
65
- value: false,
66
- },
67
- ],
68
- },
69
- drive_folder: {
70
- label: "Drive Folder",
71
- type: "string",
72
- },
73
- assign_file_tags: {
74
- label: "File Tags",
75
- type: "array",
76
- tooltip: "",
77
- render: "chips",
78
- },
79
- auto_tag_generator: {
80
- label: "Auto Tag Generator",
81
- type: "boolean",
82
- render: "segment",
83
- tooltip: "Create tags extract from file name",
84
- defaultValue: () => false,
85
- options: [
86
- {
87
- label: "Yes",
88
- value: true,
89
- },
90
- {
91
- label: "No",
92
- value: false,
93
- },
94
- ],
95
- },
96
- auto_tag_identifier: {
97
- label: "Auto Tag Identifier",
98
- type: "string",
99
- tooltip:
100
- "A character to use to separate the tags from the filename default '-'",
101
- },
102
- auto_tag_translation: {
103
- label: "Auto Tag Translation",
104
- type: "object",
105
- tooltip: "Translation is enabled by defining key-value pairs in an object.",
106
- render: "editor",
107
- "render_params.language": "json",
108
- },
109
-
110
- custom_tags_parser: {
111
- label: "Custom Tags Parser",
112
- type: "object",
113
- tooltip:
114
- "Create a custom function to extract the filename and return an array of tags.",
115
- render: "editor",
116
- "render_params.language": "javascript",
117
- },
118
- event_name_for_successful_callback: {
119
- label: "Successful Callback",
120
- type: "string",
121
- render: "eventId",
122
- },
123
- event_name_for_successful_remove_callback: {
124
- label: "Successful Remove Callback",
125
- type: "string",
126
- render: "eventId",
127
- },
128
- clear_on_file_upload: {
129
- label: "Clear on File Upload",
130
- type: "boolean",
131
- render: "segment",
132
- tooltip: "",
133
- defaultValue: () => false,
134
- options: [
135
- {
136
- label: "Yes",
137
- value: true,
138
- },
139
- {
140
- label: "No",
141
- value: false,
142
- },
143
- ],
144
- },
145
- file_upload_folder: {
146
- label: "Upload Folder",
147
- type: "string",
148
- },
149
- prompt_file_exist: {
150
- label: "Prompt file exist",
151
- type: "boolean",
152
- render: "segment",
153
- tooltip: "",
154
- defaultValue: () => true,
155
- options: [
156
- {
157
- label: "Yes",
158
- value: true,
159
- },
160
- {
161
- label: "No",
162
- value: false,
163
- },
164
- ],
165
- },
166
- direction: {
167
- label: "Direction",
168
- type: "string",
169
- render: "segment",
170
- tooltip: "",
171
- defaultValue: () => "ltr",
172
- options: [
173
- {
174
- label: "RTL",
175
- value: "rtl",
176
- },
177
- {
178
- label: "LTR",
179
- value: "ltr",
180
- },
181
- ],
182
- },
183
- navigation: {
184
- label: "Navigation",
185
- type: "boolean",
186
- render: "segment",
187
- tooltip: "",
188
- defaultValue: () => true,
189
- options: [
190
- {
191
- label: "Show",
192
- value: true,
193
- },
194
- {
195
- label: "Hide",
196
- value: false,
197
- },
198
- ],
199
- },
200
- swiper_options: {
201
- label: "Swiper options",
202
- type: "object",
203
- tooltip: "",
204
- render: "editor",
205
- "render_params.language": "json",
206
- },
207
- instant_file_upload: {
208
- label: "Instant Upload",
209
- type: "string",
210
- render: "segment",
211
- tooltip: "",
212
- options: [
213
- {
214
- label: "Yes",
215
- value: "",
216
- },
217
- {
218
- label: "No",
219
- value: "N",
220
- },
221
- ],
222
- },
223
- };
224
-
225
- export const methods = {
226
- upload: {
227
- name: "Upload",
228
- tooltip: "",
229
- fields: common_fields,
230
- response: { uploaded_files: "" },
231
- },
232
- viewer: {
233
- name: "Viewer",
234
- tooltip: "",
235
- fields: {
236
- default_view_type: {
237
- label: "Default View Type",
238
- type: "string",
239
- render: "select",
240
- tooltip: "",
241
- defaultValue: () => "gallery",
242
- options: [
243
- {
244
- label: "Gallery",
245
- value: "gallery",
246
- },
247
- {
248
- label: "List",
249
- value: "list",
250
- },
251
- {
252
- label: "Slider",
253
- value: "slider",
254
- },
255
- ],
256
- },
257
-
258
- drive_folder: {
259
- label: "Drive Folder",
260
- type: "string",
261
- },
262
- filter_tags: {
263
- label: "Filter Tags",
264
- type: "array",
265
- tooltip: "",
266
- render: "chips",
267
- },
268
- sort_by: {
269
- label: "Sort By",
270
- type: "string",
271
- render: "select",
272
- tooltip: "",
273
- defaultValue: () => "date",
274
- options: [
275
- {
276
- label: "Date",
277
- value: "date",
278
- },
279
- {
280
- label: "File Name",
281
- value: "name",
282
- },
283
- ],
284
- },
285
- sort_dir: {
286
- label: "Sort Direction",
287
- type: "string",
288
- render: "segment",
289
- tooltip: "",
290
- defaultValue: () => "desc",
291
- options: [
292
- {
293
- label: "Descending",
294
- value: "desc",
295
- },
296
- {
297
- label: "Ascending",
298
- value: "asc",
299
- },
300
- ],
301
- },
302
- show_toolbar: {
303
- label: "Show Toolbar",
304
- type: "bool",
305
- render: "segment",
306
- tooltip: "",
307
- defaultValue: () => true,
308
- options: [
309
- {
310
- label: "Yes",
311
- value: true,
312
- },
313
- {
314
- label: "No",
315
- value: false,
316
- },
317
- ],
318
- },
319
- toolbar_label: {
320
- label: "Toolbar Label",
321
- type: "string",
322
- tooltip: "",
323
- },
324
- show_upload_button: {
325
- label: "Show Upload Button",
326
- type: "bool",
327
- render: "segment",
328
- tooltip: "",
329
- defaultValue: () => true,
330
- options: [
331
- {
332
- label: "Yes",
333
- value: true,
334
- },
335
- {
336
- label: "No",
337
- value: false,
338
- },
339
- ],
340
- },
341
- ...common_fields,
342
- },
343
- response: { uploaded_files: "" },
344
- },
345
- };