solid-panes 4.4.0 → 4.4.1

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 (75) hide show
  1. package/README.md +4 -2
  2. package/dist/RDFXMLPane.css +70 -0
  3. package/dist/RDFXMLPane.d.ts +13 -0
  4. package/dist/RDFXMLPane.d.ts.map +1 -0
  5. package/dist/RDFXMLPane.js +46 -5
  6. package/dist/dataContentPane.css +271 -0
  7. package/dist/dataContentPane.d.ts +14 -0
  8. package/dist/dataContentPane.d.ts.map +1 -0
  9. package/dist/dataContentPane.js +68 -101
  10. package/dist/defaultPane.css +97 -0
  11. package/dist/defaultPane.d.ts +14 -0
  12. package/dist/defaultPane.d.ts.map +1 -0
  13. package/dist/defaultPane.js +9 -2
  14. package/dist/form/formPane.css +120 -0
  15. package/dist/form/pane.d.ts +4 -0
  16. package/dist/form/pane.d.ts.map +1 -0
  17. package/dist/form/pane.js +120 -54
  18. package/dist/humanReadablePane.css +129 -0
  19. package/dist/humanReadablePane.d.ts +13 -0
  20. package/dist/humanReadablePane.d.ts.map +1 -0
  21. package/dist/humanReadablePane.js +29 -18
  22. package/dist/icons/signUp.svg +9 -0
  23. package/dist/imagePane.css +4 -0
  24. package/dist/imagePane.d.ts +12 -0
  25. package/dist/imagePane.d.ts.map +1 -0
  26. package/dist/imagePane.js +19 -21
  27. package/dist/internal/internalPane.css +14 -0
  28. package/dist/internal/internalPane.d.ts +1 -0
  29. package/dist/internal/internalPane.d.ts.map +1 -1
  30. package/dist/internal/internalPane.js +5 -6
  31. package/dist/mainPage/header.js +2 -2
  32. package/dist/mainPage/index.d.ts +2 -1
  33. package/dist/mainPage/index.d.ts.map +1 -1
  34. package/dist/mainPage/index.js +23 -0
  35. package/dist/mainPage/menu.d.ts.map +1 -1
  36. package/dist/mainPage/menu.js +29 -2
  37. package/dist/n3Pane.css +49 -0
  38. package/dist/n3Pane.d.ts +13 -0
  39. package/dist/n3Pane.d.ts.map +1 -0
  40. package/dist/n3Pane.js +36 -5
  41. package/dist/outline/manager.js +20 -1
  42. package/dist/pad/padPane.css +6 -2
  43. package/dist/pad/padPane.js +1 -1
  44. package/dist/registerPanes.js +8 -8
  45. package/dist/schedule/schedulePane.css +294 -0
  46. package/dist/schedule/schedulePane.d.ts +23 -0
  47. package/dist/schedule/schedulePane.d.ts.map +1 -0
  48. package/dist/schedule/schedulePane.js +161 -61
  49. package/dist/social/editProfileDetails.d.ts +3 -3
  50. package/dist/social/editProfileDetails.d.ts.map +1 -1
  51. package/dist/social/editProfileDetails.js +222 -127
  52. package/dist/social/icons.d.ts +2 -0
  53. package/dist/social/icons.d.ts.map +1 -1
  54. package/dist/social/icons.js +39 -4
  55. package/dist/social/socialPane.css +838 -178
  56. package/dist/social/socialPane.d.ts.map +1 -1
  57. package/dist/social/socialPane.js +136 -43
  58. package/dist/social/socialSections.d.ts +11 -0
  59. package/dist/social/socialSections.d.ts.map +1 -1
  60. package/dist/social/socialSections.js +138 -62
  61. package/dist/social/spinner.d.ts +3 -0
  62. package/dist/social/spinner.d.ts.map +1 -0
  63. package/dist/social/spinner.js +13 -0
  64. package/dist/social/triage.d.ts +17 -0
  65. package/dist/social/triage.d.ts.map +1 -0
  66. package/dist/social/triage.js +79 -0
  67. package/dist/solid-panes.js +25772 -9576
  68. package/dist/solid-panes.js.map +1 -1
  69. package/dist/solid-panes.min.js +2583 -927
  70. package/dist/solid-panes.min.js.map +1 -1
  71. package/dist/{style → styles}/tabbedtab.css +0 -157
  72. package/dist/styles/utilities.css +5 -0
  73. package/dist/versionInfo.js +14 -14
  74. package/package.json +26 -25
  75. package/dist/icons/signup.png +0 -0
@@ -7,6 +7,8 @@ exports.schedulePane = void 0;
7
7
  var UI = _interopRequireWildcard(require("solid-ui"));
8
8
  var _solidLogic = require("solid-logic");
9
9
  var $rdf = _interopRequireWildcard(require("rdflib"));
10
+ require("./schedulePane.css");
11
+ require("../styles/utilities.css");
10
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
13
  /* Scheduler Pane
12
14
  **
@@ -19,6 +21,12 @@ const ns = UI.ns;
19
21
 
20
22
  // @@ Give other combos too-- see schedule ontology
21
23
  const possibleAvailabilities = [ns.sched('No'), ns.sched('Maybe'), ns.sched('Yes')];
24
+ function runNextAgendaItem(agenda) {
25
+ const nextTask = agenda.shift();
26
+ if (nextTask) {
27
+ nextTask();
28
+ }
29
+ }
22
30
  const schedulePane = exports.schedulePane = {
23
31
  icon: UI.icons.iconBase + 'noun_346777.svg',
24
32
  // @@ better?
@@ -124,12 +132,20 @@ const schedulePane = exports.schedulePane = {
124
132
  alert('NOT LOGGED IN');
125
133
  return;
126
134
  }
127
- const base = thisInstance.dir().uri;
128
- let newDetailsDoc, newInstance; // , newIndexDoc
129
-
135
+ const baseDir = thisInstance.dir();
136
+ if (!baseDir) {
137
+ throw new Error('Schedule pane needs a base directory to mint a new poll');
138
+ }
139
+ const base = baseDir.uri;
140
+ let newDetailsDoc;
141
+ let newInstance;
130
142
  if (options.useExisting) {
131
143
  newInstance = options.useExisting;
132
- newBase = thisInstance.dir().uri;
144
+ const existingBaseDir = thisInstance.dir();
145
+ if (!existingBaseDir) {
146
+ throw new Error('Existing schedule instance needs a containing directory');
147
+ }
148
+ newBase = existingBaseDir.uri;
133
149
  newDetailsDoc = newInstance.doc();
134
150
  // newIndexDoc = null
135
151
  if (options.newBase) {
@@ -141,7 +157,7 @@ const schedulePane = exports.schedulePane = {
141
157
  newInstance = kb.sym(newDetailsDoc.uri + '#event');
142
158
  }
143
159
  const newResultsDoc = kb.sym(newBase + 'results.ttl');
144
- const toBeCopied = options.noIndexHTML ? {} : [{
160
+ const toBeCopied = options.noIndexHTML ? [] : [{
145
161
  local: 'index.html',
146
162
  contentType: 'text/html'
147
163
  }];
@@ -160,7 +176,7 @@ const schedulePane = exports.schedulePane = {
160
176
  complainIfBad(ok, 'FAILED to set ACL ' + newURI + ' : ' + message);
161
177
  console.log('FAILED to set ACL ' + newURI + ' : ' + message);
162
178
  } else {
163
- agenda.shift()(); // beware too much nesting
179
+ runNextAgendaItem(agenda); // beware too much nesting
164
180
  }
165
181
  });
166
182
  };
@@ -181,11 +197,11 @@ const schedulePane = exports.schedulePane = {
181
197
  kb.add(newInstance, ns.dc('author'), me, newDetailsDoc); // Who is sending the invitation?
182
198
  kb.add(newInstance, ns.foaf('maker'), me, newDetailsDoc); // Uneditable - wh is allowed to edit this?
183
199
  }
184
- kb.add(newInstance, ns.dc('created'), new Date(), newDetailsDoc);
200
+ kb.add(newInstance, ns.dc('created'), $rdf.literal(new Date().toISOString(), $rdf.sym('http://www.w3.org/2001/XMLSchema#dateTime')), newDetailsDoc);
185
201
  kb.add(newInstance, ns.sched('resultsDocument'), newDetailsDoc);
186
202
  updater.put(newDetailsDoc, kb.statementsMatching(undefined, undefined, undefined, newDetailsDoc), 'text/turtle', function (uri2, ok, message) {
187
203
  if (ok) {
188
- agenda.shift()();
204
+ runNextAgendaItem(agenda);
189
205
  } else {
190
206
  complainIfBad(ok, 'FAILED to save new scheduler at: ' + newDetailsDoc + ' : ' + message);
191
207
  console.log('FAILED to save new scheduler at: ' + newDetailsDoc + ' : ' + message);
@@ -197,7 +213,7 @@ const schedulePane = exports.schedulePane = {
197
213
  data: '',
198
214
  contentType: 'text/turtle'
199
215
  }).then(() => {
200
- agenda.shift()();
216
+ runNextAgendaItem(agenda);
201
217
  }).catch(err => {
202
218
  complainIfBad(false, 'Failed to initialize empty results file: ' + err.message);
203
219
  });
@@ -205,13 +221,13 @@ const schedulePane = exports.schedulePane = {
205
221
  agenda.push(function () {
206
222
  setACL2(newResultsDoc.uri, true, function (ok, body) {
207
223
  complainIfBad(ok, 'Failed to set Read-Write ACL on results file: ' + body);
208
- if (ok) agenda.shift()();
224
+ if (ok) runNextAgendaItem(agenda);
209
225
  });
210
226
  });
211
227
  agenda.push(function () {
212
228
  setACL2(newDetailsDoc.uri, false, function (ok, body) {
213
229
  complainIfBad(ok, 'Failed to set read ACL on configuration file: ' + body);
214
- if (ok) agenda.shift()();
230
+ if (ok) runNextAgendaItem(agenda);
215
231
  });
216
232
  });
217
233
  agenda.push(function () {
@@ -220,7 +236,7 @@ const schedulePane = exports.schedulePane = {
220
236
  options.newInstance = newInstance;
221
237
  resolve(options);
222
238
  });
223
- agenda.shift()();
239
+ runNextAgendaItem(agenda);
224
240
  // Created new data files.
225
241
  }); // promise
226
242
  },
@@ -234,6 +250,11 @@ const schedulePane = exports.schedulePane = {
234
250
  const invitation = subject;
235
251
  const appPathSegment = 'app-when-can-we.w3.org'; // how to allocate this string and connect to
236
252
 
253
+ function applyEnvironmentAttributes(element) {
254
+ const environment = context.environment ?? {};
255
+ element.dataset.layout = environment.layout ?? 'desktop';
256
+ }
257
+
237
258
  // ////////////////////////////////////////////
238
259
 
239
260
  const fetcher = kb.fetcher;
@@ -242,6 +263,9 @@ const schedulePane = exports.schedulePane = {
242
263
  const thisInstance = subject;
243
264
  const detailsDoc = subject.doc();
244
265
  const baseDir = detailsDoc.dir();
266
+ if (!baseDir) {
267
+ throw new Error('Schedule pane needs a containing directory for its details document');
268
+ }
245
269
  const base = baseDir.uri;
246
270
  const resultsDoc = $rdf.sym(base + 'results.ttl');
247
271
  // const formsURI = base + 'forms.ttl'
@@ -252,9 +276,6 @@ const schedulePane = exports.schedulePane = {
252
276
  const form3 = kb.sym(formsURI + '#form3');
253
277
  $rdf.parse(formText, kb, formsURI, 'text/turtle'); // Load forms directly
254
278
 
255
- const inputStyle = 'background-color: #eef; padding: 0.5em; border: .5em solid white; font-size: 100%'; // font-size: 120%
256
- const buttonIconStyle = 'width: 1.8em; height: 1.8em;';
257
-
258
279
  // Utility functions
259
280
 
260
281
  const complainIfBad = function (ok, message) {
@@ -271,12 +292,13 @@ const schedulePane = exports.schedulePane = {
271
292
  const refreshCellColor = function (cell, value) {
272
293
  const bg = kb.any(value, UI.ns.ui('backgroundColor'));
273
294
  if (bg) {
274
- cell.setAttribute('style', 'padding: 0.3em; text-align: center; background-color: ' + bg + ';');
295
+ cell.classList.add('schedule-pane__cell');
296
+ cell.setAttribute('style', 'background-color: ' + bg + ';');
275
297
  }
276
298
  };
277
- let me;
299
+ let me = null;
278
300
  _solidLogic.authn.checkUser().then(webId => {
279
- me = webId;
301
+ me = webId ?? null;
280
302
  if (logInOutButton) {
281
303
  logInOutButton.refresh();
282
304
  }
@@ -294,20 +316,26 @@ const schedulePane = exports.schedulePane = {
294
316
 
295
317
  const newInstanceButton = function () {
296
318
  const b = UI.login.newAppInstance(dom, {
297
- noun: 'scheduler'
298
- }, initializeNewInstanceInWorkspace);
299
- b.firstChild.setAttribute('style', inputStyle);
319
+ noun: 'scheduler',
320
+ appPathSegment
321
+ }, function (workspace, newBase) {
322
+ return initializeNewInstanceInWorkspace($rdf.sym(workspace || newBase));
323
+ });
324
+ if (b.firstChild instanceof HTMLElement) {
325
+ b.firstChild.classList.add('schedule-pane__button');
326
+ }
300
327
  return b;
301
328
  }; // newInstanceButton
302
329
 
303
330
  // /////////////////////// Create new document files for new instance of app
304
331
 
305
332
  const initializeNewInstanceInWorkspace = function (ws) {
306
- let newBase = kb.any(ws, ns.space('uriPrefix'));
307
- if (!newBase) {
333
+ const uriPrefix = kb.any(ws, ns.space('uriPrefix'));
334
+ let newBase = '';
335
+ if (!uriPrefix) {
308
336
  newBase = ws.uri.split('#')[0];
309
337
  } else {
310
- newBase = newBase.value;
338
+ newBase = uriPrefix.value;
311
339
  }
312
340
  if (newBase.slice(-1) !== '/') {
313
341
  $rdf.log.error(appPathSegment + ': No / at end of uriPrefix ' + newBase); // @@ paramater?
@@ -323,7 +351,10 @@ const schedulePane = exports.schedulePane = {
323
351
  thisInstance,
324
352
  newBase
325
353
  };
326
- this.mintNew(context, options).then(function (options) {
354
+ schedulePane.mintNew(context, options).then(function (options) {
355
+ if (!options.newInstance) {
356
+ throw new Error('New scheduler instance was not returned');
357
+ }
327
358
  const p = div.appendChild(dom.createElement('p'));
328
359
  p.setAttribute('style', 'font-size: 140%;');
329
360
  p.innerHTML = 'Your <a href=\'' + options.newInstance.uri + '\'><b>new scheduler</b></a> is ready to be set up. ' + '<br/><br/><a href=\'' + options.newInstance.uri + '\'>Say when you what days work for you.</a>';
@@ -365,7 +396,7 @@ const schedulePane = exports.schedulePane = {
365
396
 
366
397
  if (!kb.updater.editable(detailsDoc.uri, kb) || kb.holds(subject, ns.rdf('type'), ns.wf('TemplateInstance'))) {
367
398
  // This is read-only example e.g. on github pages, etc
368
- showBootstrap(div);
399
+ showBootstrap();
369
400
  return;
370
401
  }
371
402
  const ready = kb.any(subject, ns.sched('ready'));
@@ -384,7 +415,7 @@ const schedulePane = exports.schedulePane = {
384
415
  dom
385
416
  };
386
417
  UI.login.ensureLoggedIn(signonContext).then(context => {
387
- me = context.me;
418
+ me = context.me ?? null;
388
419
  waitingForLogin = false; // untested
389
420
  showAppropriateDisplay();
390
421
  });
@@ -392,8 +423,11 @@ const schedulePane = exports.schedulePane = {
392
423
  const showBootstrap = function showBootstrap() {
393
424
  const div = clearElement(naviMain);
394
425
  div.appendChild(UI.login.newAppInstance(dom, {
395
- noun: 'poll'
396
- }, initializeNewInstanceInWorkspace));
426
+ noun: 'poll',
427
+ appPathSegment
428
+ }, function (workspace, newBase) {
429
+ return initializeNewInstanceInWorkspace($rdf.sym(workspace || newBase));
430
+ }));
397
431
  div.appendChild(dom.createElement('hr')); // @@
398
432
 
399
433
  const p = div.appendChild(dom.createElement('p'));
@@ -406,7 +440,7 @@ const schedulePane = exports.schedulePane = {
406
440
  div.appendChild(dom.createElement('br')); // @@
407
441
 
408
442
  const button = div.appendChild(dom.createElement('button'));
409
- button.setAttribute('style', inputStyle);
443
+ button.classList.add('schedule-pane__button');
410
444
  button.textContent = 'Start new poll at this URI';
411
445
  button.addEventListener('click', function (_e) {
412
446
  let newBase = baseField.value;
@@ -426,7 +460,7 @@ const schedulePane = exports.schedulePane = {
426
460
 
427
461
  // form2 depends on sched:allDay; seed a local default for new polls
428
462
  if (!kb.any(subject, ns.sched('allDay'))) {
429
- kb.add(subject, ns.sched('allDay'), $rdf.literal('true', undefined, $rdf.sym('http://www.w3.org/2001/XMLSchema#boolean')), detailsDoc);
463
+ kb.add(subject, ns.sched('allDay'), $rdf.literal('true', $rdf.sym('http://www.w3.org/2001/XMLSchema#boolean')), detailsDoc);
430
464
  }
431
465
  const wizard = true;
432
466
  let currentSlide = 0;
@@ -446,6 +480,60 @@ const schedulePane = exports.schedulePane = {
446
480
  const fallbackForm = kb.sym(formsURI + (allDayValue ? '#AllDayForm2' : '#NotAllDayForm2'));
447
481
  UI.widgets.appendForm(document, slide, {}, subject, fallbackForm, detailsDoc, complainIfBad);
448
482
  };
483
+ const annotateRenderedForm = function (container, includePrimaryFields = false) {
484
+ const controls = Array.from(container.querySelectorAll('input, select, textarea'));
485
+ controls.forEach(control => {
486
+ control.classList.add('schedule-pane__form-control');
487
+ if (control.tagName.toLowerCase() === 'textarea') {
488
+ control.classList.add('schedule-pane__form-control--textarea');
489
+ }
490
+ });
491
+ const borderedPanels = Array.from(container.querySelectorAll('div[style*="border: 0.05em solid"]'));
492
+ borderedPanels.forEach(panel => {
493
+ panel.classList.add('schedule-pane__panel');
494
+ });
495
+ const headings = Array.from(container.querySelectorAll('h3'));
496
+ headings.forEach(heading => {
497
+ heading.classList.add('schedule-pane__form-heading');
498
+ const headingText = (heading.textContent || '').trim().toLowerCase();
499
+ if (headingText === 'time proposals') {
500
+ heading.classList.add('schedule-pane__form-heading--time-proposals');
501
+ heading.closest('.schedule-pane__panel')?.classList.add('schedule-pane__panel--time-proposals');
502
+ }
503
+ });
504
+ if (!includePrimaryFields) {
505
+ return;
506
+ }
507
+ const labels = Array.from(container.querySelectorAll('.formFieldName'));
508
+ labels.forEach(labelElement => {
509
+ const row = labelElement.parentElement;
510
+ const labelText = (labelElement.textContent || '').trim().toLowerCase();
511
+ if (!row) return;
512
+ if (labelText === 'summary' || labelText === 'location') {
513
+ row.classList.add('schedule-pane__field-row--compact');
514
+ }
515
+ if (labelText === 'comment') {
516
+ row.classList.add('schedule-pane__field-row--comment');
517
+ }
518
+ });
519
+ const commentField = container.querySelector('textarea');
520
+ const commentFieldWrapper = commentField?.parentElement;
521
+ const commentValueCell = commentFieldWrapper?.parentElement;
522
+ const commentRow = commentValueCell?.parentElement;
523
+ if (commentRow) {
524
+ commentRow.classList.add('schedule-pane__field-row--comment');
525
+ }
526
+ if (commentValueCell) {
527
+ commentValueCell.classList.add('schedule-pane__field-value--comment');
528
+ }
529
+ };
530
+ const unwrapSlide = function (slide) {
531
+ const firstElement = slide.firstElementChild;
532
+ if (!firstElement || slide.childElementCount !== 1) {
533
+ return slide;
534
+ }
535
+ return firstElement;
536
+ };
449
537
  if (wizard) {
450
538
  const forms = [form1, form2, form3];
451
539
  const slides = [];
@@ -453,12 +541,14 @@ const schedulePane = exports.schedulePane = {
453
541
  for (let f = 0; f < forms.length; f++) {
454
542
  const slide = dom.createElement('div');
455
543
  UI.widgets.appendForm(document, slide, {}, subject, forms[f], detailsDoc, complainIfBad);
544
+ annotateRenderedForm(slide, f === 0);
456
545
 
457
546
  // Some stores end up with form2's ui:Options unresolved; force a usable input form.
458
547
  if (f === 1 && !hasFormControls(slide)) {
459
548
  renderTimeProposalFallback(slide);
549
+ annotateRenderedForm(slide);
460
550
  }
461
- slides.push(slide);
551
+ slides.push(unwrapSlide(slide));
462
552
  }
463
553
  const refresh = function () {
464
554
  clearElement(naviMain).appendChild(slides[currentSlide]);
@@ -480,7 +570,7 @@ const schedulePane = exports.schedulePane = {
480
570
  }
481
571
  };
482
572
  const b1 = clearElement(naviLeft).appendChild(dom.createElement('button'));
483
- b1.setAttribute('style', inputStyle);
573
+ b1.classList.add('schedule-pane__button');
484
574
  b1.textContent = '<- go back';
485
575
  b1.addEventListener('click', function (_e) {
486
576
  if (currentSlide > 0) {
@@ -489,7 +579,7 @@ const schedulePane = exports.schedulePane = {
489
579
  }
490
580
  }, false);
491
581
  const b2 = clearElement(naviRight).appendChild(dom.createElement('button'));
492
- b2.setAttribute('style', inputStyle);
582
+ b2.classList.add('schedule-pane__button');
493
583
  b2.textContent = 'continue ->';
494
584
  b2.addEventListener('click', function (_e) {
495
585
  if (currentSlide < slides.length - 1) {
@@ -503,18 +593,21 @@ const schedulePane = exports.schedulePane = {
503
593
  // @@@ create the initial config doc if not exist
504
594
  const table = div.appendChild(dom.createElement('table'));
505
595
  UI.widgets.appendForm(document, table, {}, subject, form1, detailsDoc, complainIfBad);
596
+ annotateRenderedForm(table, true);
506
597
  UI.widgets.appendForm(document, table, {}, subject, form2, detailsDoc, complainIfBad);
598
+ annotateRenderedForm(table);
507
599
  UI.widgets.appendForm(document, table, {}, subject, form3, detailsDoc, complainIfBad);
600
+ annotateRenderedForm(table);
508
601
  naviCenter.appendChild(doneButton); // could also check data shape
509
602
  }
510
603
  // @@@ link config to results
511
604
 
512
605
  const insertables = [];
513
606
  insertables.push($rdf.st(subject, ns.sched('availabilityOptions'), ns.sched('YesNoMaybe'), detailsDoc));
514
- insertables.push($rdf.st(subject, ns.sched('ready'), new Date(), detailsDoc));
607
+ insertables.push($rdf.st(subject, ns.sched('ready'), $rdf.literal(new Date().toISOString(), $rdf.sym('http://www.w3.org/2001/XMLSchema#dateTime')), detailsDoc));
515
608
  insertables.push($rdf.st(subject, ns.sched('results'), resultsDoc, detailsDoc)); // @@ also link in results
516
609
 
517
- doneButton.setAttribute('style', inputStyle);
610
+ doneButton.classList.add('schedule-pane__button');
518
611
  doneButton.textContent = 'Go to poll';
519
612
  doneButton.addEventListener('click', function (_e) {
520
613
  if (kb.any(subject, ns.sched('ready'))) {
@@ -534,10 +627,10 @@ const schedulePane = exports.schedulePane = {
534
627
  }
535
628
  }, false);
536
629
  const emailButton = dom.createElement('button');
537
- emailButton.setAttribute('style', inputStyle);
630
+ emailButton.classList.add('schedule-pane__button');
538
631
  const emailIcon = emailButton.appendChild(dom.createElement('img'));
539
632
  emailIcon.setAttribute('src', UI.icons.iconBase + 'noun_480183.svg'); // noun_480183.svg
540
- emailIcon.setAttribute('style', buttonIconStyle);
633
+ emailIcon.classList.add('schedule-pane__button-icon');
541
634
  // emailButton.textContent = 'email invitations'
542
635
  emailButton.addEventListener('click', function (_e) {
543
636
  const title = kb.anyValue(subject, ns.cal('summary')) || kb.anyValue(subject, ns.dc('title')) || '';
@@ -710,7 +803,7 @@ const schedulePane = exports.schedulePane = {
710
803
  const comment = kb.any(invitation, ns.cal('comment'));
711
804
  const location = kb.any(invitation, ns.cal('location'));
712
805
  const div = naviMain;
713
- if (title) div.appendChild(dom.createElement('h3')).textContent = title;
806
+ if (title) div.appendChild(dom.createElement('h3')).textContent = title.value;
714
807
  if (location) {
715
808
  div.appendChild(dom.createElement('address')).textContent = location.value;
716
809
  }
@@ -721,15 +814,17 @@ const schedulePane = exports.schedulePane = {
721
814
  if (author) {
722
815
  const authorName = kb.any(author, ns.foaf('name'));
723
816
  if (authorName) {
724
- div.appendChild(dom.createElement('p')).textContent = authorName;
817
+ div.appendChild(dom.createElement('p')).textContent = authorName.value;
725
818
  }
726
819
  }
727
- const query = new $rdf.Query('Responses');
820
+ const query = new $rdf.Query('Responses', 0);
728
821
  const v = {};
729
- const vs = ['time', 'author', 'value', 'resp', 'cell'];
730
- vs.forEach(function (x) {
731
- query.vars.push(v[x] = $rdf.variable(x));
732
- });
822
+ v.time = $rdf.variable('time');
823
+ v.author = $rdf.variable('author');
824
+ v.value = $rdf.variable('value');
825
+ v.resp = $rdf.variable('resp');
826
+ v.cell = $rdf.variable('cell');
827
+ query.vars.push(v.time, v.author, v.value, v.resp, v.cell);
733
828
  query.pat.add(invitation, ns.sched('response'), v.resp);
734
829
  query.pat.add(v.resp, ns.dc('author'), v.author);
735
830
  query.pat.add(v.resp, ns.sched('cell'), v.cell);
@@ -738,7 +833,10 @@ const schedulePane = exports.schedulePane = {
738
833
 
739
834
  // Sort by by person @@@
740
835
 
741
- const options = {};
836
+ const options = {
837
+ set_x: [],
838
+ set_y: []
839
+ };
742
840
  options.set_x = kb.each(subject, ns.sched('option')); // @@@@@ option -> dtstart in future
743
841
  options.set_x = options.set_x.map(function (opt) {
744
842
  return kb.any(opt, ns.cal('dtstart'));
@@ -760,11 +858,11 @@ const schedulePane = exports.schedulePane = {
760
858
  const matrix = div.appendChild(UI.matrix.matrixForQuery(dom, query, v.time, v.author, v.value, options, function () {}));
761
859
  matrix.setAttribute('class', 'matrix');
762
860
  const refreshButton = dom.createElement('button');
763
- refreshButton.setAttribute('style', inputStyle);
861
+ refreshButton.classList.add('schedule-pane__button');
764
862
  // refreshButton.textContent = 'refresh' // noun_479395.svg
765
863
  const refreshIcon = dom.createElement('img');
766
864
  refreshIcon.setAttribute('src', UI.icons.iconBase + 'noun_479395.svg');
767
- refreshIcon.setAttribute('style', buttonIconStyle);
865
+ refreshIcon.classList.add('schedule-pane__button-icon');
768
866
  refreshButton.appendChild(refreshIcon);
769
867
  refreshButton.addEventListener('click', function (_e) {
770
868
  refreshButton.disabled = true;
@@ -786,13 +884,16 @@ const schedulePane = exports.schedulePane = {
786
884
 
787
885
  // const me = authn.currentUser()
788
886
 
789
- const dataPointForNT = [];
887
+ const dataPointForNT = {};
790
888
  const loginContext = {
791
889
  div: naviCenter,
792
890
  dom
793
891
  };
794
892
  UI.login.ensureLoggedIn(loginContext).then(context => {
795
893
  const me = context.me;
894
+ if (!me) {
895
+ return;
896
+ }
796
897
  const doc = resultsDoc;
797
898
  options.set_y = options.set_y.filter(function (z) {
798
899
  return !z.sameTerm(me);
@@ -808,16 +909,18 @@ const schedulePane = exports.schedulePane = {
808
909
  if (y.sameTerm(me)) {
809
910
  const callbackFunction = function () {
810
911
  refreshCellColor(cell, value);
912
+ return '';
811
913
  }; // @@ may need that
812
914
  const selectOptions = {};
813
915
  const predicate = ns.sched('availabilty');
814
- if (!x) return;
916
+ if (!x) return '';
815
917
  const cellSubject = dataPointForNT[x.toNT()];
816
918
  const selector = UI.widgets.makeSelectForOptions(dom, kb, cellSubject, predicate, possibleAvailabilities, selectOptions, resultsDoc, callbackFunction);
817
919
  cell.appendChild(selector);
818
920
  } else if (value !== null) {
819
921
  cell.textContent = UI.utils.label(value);
820
922
  }
923
+ return '';
821
924
  };
822
925
  const responses = kb.each(invitation, ns.sched('response'));
823
926
  let myResponse = null;
@@ -867,13 +970,13 @@ const schedulePane = exports.schedulePane = {
867
970
  // If I made this in the first place, allow me to edit it.
868
971
  // @@ optionally -- allows others to if according to original
869
972
  const instanceCreator = kb.any(subject, ns.foaf('maker')); // owner?
870
- if (!instanceCreator || instanceCreator.sameTerm(me)) {
973
+ if (!instanceCreator || !me || instanceCreator.sameTerm(me)) {
871
974
  const editButton = dom.createElement('button');
872
- editButton.setAttribute('style', inputStyle);
975
+ editButton.classList.add('schedule-pane__button');
873
976
  // editButton.textContent = '(Modify the poll)' // noun_344563.svg
874
977
  const editIcon = dom.createElement('img');
875
978
  editIcon.setAttribute('src', UI.icons.iconBase + 'noun_344563.svg');
876
- editIcon.setAttribute('style', buttonIconStyle);
979
+ editIcon.classList.add('schedule-pane__button-icon');
877
980
  editButton.appendChild(editIcon);
878
981
  editButton.addEventListener('click', function (_e) {
879
982
  clearElement(div);
@@ -890,12 +993,10 @@ const schedulePane = exports.schedulePane = {
890
993
  } // showResults
891
994
 
892
995
  const div = dom.createElement('div');
996
+ div.classList.add('schedule-pane');
997
+ applyEnvironmentAttributes(div);
893
998
  const structure = div.appendChild(dom.createElement('table')); // @@ make responsive style
894
- structure.setAttribute('style', 'background-color: white; min-width: 40em; min-height: 13em;');
895
- const naviLoginoutTR = structure.appendChild(dom.createElement('tr'));
896
- naviLoginoutTR.appendChild(dom.createElement('td'));
897
- naviLoginoutTR.appendChild(dom.createElement('td'));
898
- naviLoginoutTR.appendChild(dom.createElement('td'));
999
+ structure.classList.add('schedule-pane__table');
899
1000
  const logInOutButton = null;
900
1001
  /*
901
1002
  const logInOutButton = UI.login.loginStatusBox(dom, setUser)
@@ -907,11 +1008,10 @@ const schedulePane = exports.schedulePane = {
907
1008
 
908
1009
  const naviTop = structure.appendChild(dom.createElement('tr'));
909
1010
  const naviMain = naviTop.appendChild(dom.createElement('td'));
1011
+ naviMain.classList.add('schedule-pane__main-cell');
910
1012
  naviMain.setAttribute('colspan', '3');
911
1013
  const naviMenu = structure.appendChild(dom.createElement('tr'));
912
- naviMenu.setAttribute('class', 'naviMenu');
913
- naviMenu.setAttribute('style', ' text-align: middle; vertical-align: middle; padding-top: 4em; ');
914
- // naviMenu.setAttribute('style', 'margin-top: 3em;')
1014
+ naviMenu.classList.add('naviMenu', 'schedule-pane__nav');
915
1015
  const naviLeft = naviMenu.appendChild(dom.createElement('td'));
916
1016
  const naviCenter = naviMenu.appendChild(dom.createElement('td'));
917
1017
  const naviRight = naviMenu.appendChild(dom.createElement('td'));
@@ -1,4 +1,5 @@
1
1
  import { LiveStore, NamedNode } from 'rdflib';
2
+ import 'solid-ui/components/button';
2
3
  type ProfileLinkField = {
3
4
  key: 'homepage' | 'weblog' | 'workplaceHomepage' | 'schoolHomepage';
4
5
  label: string;
@@ -9,11 +10,10 @@ type EditProfileDetailsButtonOptions = {
9
10
  dom: HTMLDocument;
10
11
  store: LiveStore;
11
12
  subject: NamedNode;
12
- header: HTMLElement;
13
13
  onSaved: () => void;
14
14
  };
15
15
  export declare const profileLinkFields: ProfileLinkField[];
16
- export declare function appendProfileLinks(container: HTMLElement, dom: HTMLDocument, store: LiveStore, subject: NamedNode): void;
17
- export declare function createEditProfileDetailsButton(options: EditProfileDetailsButtonOptions): HTMLButtonElement;
16
+ export declare function appendProfileLinks(_container: HTMLElement, _dom: HTMLDocument, _store: LiveStore, _subject: NamedNode): void;
17
+ export declare function createEditProfileDetailsButton(options: EditProfileDetailsButtonOptions): HTMLElement;
18
18
  export {};
19
19
  //# sourceMappingURL=editProfileDetails.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editProfileDetails.d.ts","sourceRoot":"","sources":["../../src/social/editProfileDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AActD,KAAK,gBAAgB,GAAG;IACtB,GAAG,EAAE,UAAU,GAAG,QAAQ,GAAG,mBAAmB,GAAG,gBAAgB,CAAA;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAID,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,SAAS,CAAA;IAClB,MAAM,EAAE,WAAW,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAyB/C,CAAA;AAuFD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,GACjB,IAAI,CA2CN;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,+BAA+B,GACvC,iBAAiB,CAiJnB"}
1
+ {"version":3,"file":"editProfileDetails.d.ts","sourceRoot":"","sources":["../../src/social/editProfileDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAGtD,OAAO,4BAA4B,CAAA;AAsBnC,KAAK,gBAAgB,GAAG;IACtB,GAAG,EAAE,UAAU,GAAG,QAAQ,GAAG,mBAAmB,GAAG,gBAAgB,CAAA;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAID,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAyB/C,CAAA;AAsGD,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,WAAW,EACvB,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,SAAS,GAClB,IAAI,CAGN;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,+BAA+B,GACvC,WAAW,CAiRb"}