dcp-client 5.8.2 → 5.8.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/assets/dcp-modal.css +32 -5
- package/dcp-client.js +10 -2
- package/dist/dcp-client-bundle.js +1 -1
- package/dist/dcp-client-bundle.js.map +1 -1
- package/libexec/sandbox/polyfills.js +192 -0
- package/package.json +2 -2
package/assets/dcp-modal.css
CHANGED
|
@@ -288,6 +288,7 @@ DIALOG#dcp-modal.dcp-modal-upload:has(#dcp-modal-drop-target) #dcp-modal-content
|
|
|
288
288
|
padding-top: 0;
|
|
289
289
|
}
|
|
290
290
|
DIALOG#dcp-modal.dcp-modal-upload #dcp-modal-drop-target {
|
|
291
|
+
position: relative;
|
|
291
292
|
margin-top: 1em;
|
|
292
293
|
display: inline-block;
|
|
293
294
|
border: 2px dashed #bbb;
|
|
@@ -300,10 +301,19 @@ DIALOG#dcp-modal.dcp-modal-upload #dcp-modal-drop-label {
|
|
|
300
301
|
transform: translateY(-0.9em);
|
|
301
302
|
color: grey;
|
|
302
303
|
background: white;
|
|
303
|
-
padding: 2px 4px 2px 4px;
|
|
304
304
|
font-size: 0.75em;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
+
DIALOG#dcp-modal.dcp-modal-upload[drag-state]:not([drag-state=""]) {
|
|
308
|
+
cursor: grabbing;
|
|
309
|
+
* {
|
|
310
|
+
cursor: grabbing;
|
|
311
|
+
}
|
|
312
|
+
#dcp-modal-drop-label {
|
|
313
|
+
color: black;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
307
317
|
/** Control the behaviour of the upload modal when drag/dropping to give user feedback */
|
|
308
318
|
DIALOG#dcp-modal.dcp-modal-upload #dcp-modal-icon {
|
|
309
319
|
transition: all 100ms linear;
|
|
@@ -321,13 +331,33 @@ DIALOG#dcp-modal.dcp-modal-upload[drag-state="over"] {
|
|
|
321
331
|
cursor: copy;
|
|
322
332
|
}
|
|
323
333
|
DIALOG#dcp-modal.dcp-modal-upload[drag-state="invalid"] #dcp-modal-drop-target {
|
|
324
|
-
opacity:
|
|
334
|
+
opacity: 1;
|
|
335
|
+
border-color: #999;
|
|
325
336
|
}
|
|
326
337
|
DIALOG#dcp-modal.dcp-modal-upload[drag-state="invalid"] #dcp-modal-icon {
|
|
327
338
|
font-size: 0;
|
|
328
339
|
opacity: 0;
|
|
329
340
|
}
|
|
341
|
+
DIALOG#dcp-modal.dcp-modal-upload[error] {
|
|
342
|
+
#dcp-modal-drop-target {
|
|
343
|
+
border-color: red;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
330
346
|
|
|
347
|
+
/** dcp-modal-paste-target is an invisible Create */
|
|
348
|
+
DIALOG#dcp-modal.dcp-modal-upload {
|
|
349
|
+
#dcp-modal-paste-target {
|
|
350
|
+
transform: translateY(-0.9em); /* match dcp-modal-drop-label */
|
|
351
|
+
position: absolute;
|
|
352
|
+
height: calc(100% - 2px); /* match border */
|
|
353
|
+
height: 100%;
|
|
354
|
+
width: 100%;
|
|
355
|
+
color: transparent;
|
|
356
|
+
}
|
|
357
|
+
#dcp-modal-paste-target:focus {
|
|
358
|
+
outline: 0px solid transparent;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
331
361
|
/**
|
|
332
362
|
* Password dialogs can have one or two label+input divs, depending on need (enter vs create).
|
|
333
363
|
*/
|
|
@@ -346,9 +376,6 @@ DIALOG#dcp-modal:has(#dcp-modal-password-prompt) {
|
|
|
346
376
|
padding-right: 0.5em;
|
|
347
377
|
width: 25ch;
|
|
348
378
|
}
|
|
349
|
-
LABEL::after {
|
|
350
|
-
content: ":";
|
|
351
|
-
}
|
|
352
379
|
|
|
353
380
|
#dcp-modal-password-prompt,
|
|
354
381
|
#dcp-modal-password-confirm-prompt {
|
package/dcp-client.js
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* - onready: same as onload, but dcp is also defined.
|
|
10
10
|
* - scheduler: set the URL for the scheduler, also used to locate dcpConfig
|
|
11
11
|
* - bundle: set the URL for the bundle to load, default is the one in this directory
|
|
12
|
-
*
|
|
12
|
+
* - identity: API key to use for setting dcp identity
|
|
13
|
+
*
|
|
14
|
+
* @author Wes Garland, wes@distributive.network
|
|
13
15
|
* @date Aug 2019
|
|
14
16
|
*/
|
|
15
17
|
'use strict';
|
|
@@ -348,7 +350,10 @@ https://distributive.network/`, "font-weight: bold; font-size: 1.2em; color: #00
|
|
|
348
350
|
var bundleSrc = thisScript.getAttribute("bundle") || (thisScript.src.replace('/dcp-client.js', '/dist/dcp-client-bundle.js'));
|
|
349
351
|
|
|
350
352
|
bundleScript.setAttribute('type', 'text/javascript');
|
|
351
|
-
|
|
353
|
+
if (thisScriptURL.searchParams.has('cache-key'))
|
|
354
|
+
bundleScript.setAttribute('src', bundleSrc + '?cache-key=' + thisScriptURL.searchParams.get('cache-key'));
|
|
355
|
+
else
|
|
356
|
+
bundleScript.setAttribute('src', bundleSrc);
|
|
352
357
|
bundleScript.setAttribute('id', '_dcp_client_bundle');
|
|
353
358
|
bundleScript.setAttribute('dcp-env', 'vanilla-web');
|
|
354
359
|
bundleScript.setAttribute('onerror', `alert('Error DCP-1002: Could not load dcp-client bundle from URL ("${bundleSrc}")')`);
|
|
@@ -376,6 +381,9 @@ https://distributive.network/`, "font-weight: bold; font-size: 1.2em; color: #00
|
|
|
376
381
|
return;
|
|
377
382
|
href = thisScriptURL.origin + thisScriptURL.pathname
|
|
378
383
|
.replace(/\/dcp-client\/dcp-client.js$/, '/dcp-client/assets/dcp-client.css');
|
|
384
|
+
if (thisScriptURL.searchParams.has('cache-key'))
|
|
385
|
+
href += '?cache-key=' + thisScriptURL.searchParams.get('cache-key');
|
|
386
|
+
|
|
379
387
|
const head = document.getElementsByTagName('head')[0];
|
|
380
388
|
let styleLink = document.createElement('link');
|
|
381
389
|
styleLink.rel = 'stylesheet';
|