solid-panes 3.7.3 → 4.0.0-cc645f25
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/dist/RDFXMLPane.js +59 -0
- package/dist/RDFXMLPane.js.map +1 -0
- package/{lib → dist}/argument/argumentPane.js +14 -15
- package/dist/argument/argumentPane.js.map +1 -0
- package/{lib → dist}/attach/attachPane.js +83 -93
- package/dist/attach/attachPane.js.map +1 -0
- package/{lib → dist}/audio/audioPane.js +49 -50
- package/dist/audio/audioPane.js.map +1 -0
- package/{lib → dist}/classInstancePane.js +23 -24
- package/dist/classInstancePane.js.map +1 -0
- package/dist/dashboard/basicPreferences.js +147 -0
- package/dist/dashboard/basicPreferences.js.map +1 -0
- package/{lib → dist}/dashboard/dashboardPane.js +17 -21
- package/dist/dashboard/dashboardPane.js.map +1 -0
- package/dist/dashboard/homepage.js +54 -0
- package/dist/dashboard/homepage.js.map +1 -0
- package/{lib → dist}/dataContentPane.js +64 -63
- package/dist/dataContentPane.js.map +1 -0
- package/{lib → dist}/defaultPane.js +15 -16
- package/dist/defaultPane.js.map +1 -0
- package/{lib → dist}/dokieli/dokieliPane.js +49 -53
- package/dist/dokieli/dokieliPane.js.map +1 -0
- package/{src → dist}/dokieli/new.js +9 -3
- package/dist/dokieli/new.js.map +1 -0
- package/{lib → dist}/form/pane.js +44 -45
- package/dist/form/pane.js.map +1 -0
- package/dist/home/homePane.js +73 -0
- package/dist/home/homePane.js.map +1 -0
- package/dist/humanReadablePane.js +135 -0
- package/dist/humanReadablePane.js.map +1 -0
- package/dist/imagePane.js +70 -0
- package/dist/imagePane.js.map +1 -0
- package/{lib → dist}/index.js +17 -20
- package/dist/index.js.map +1 -0
- package/{lib → dist}/internal/internalPane.js +41 -41
- package/dist/internal/internalPane.js.map +1 -0
- package/{lib → dist}/mainPage/footer.js +2 -2
- package/{lib → dist}/mainPage/footer.js.map +1 -1
- package/dist/mainPage/header.js +86 -0
- package/dist/mainPage/header.js.map +1 -0
- package/{lib → dist}/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.js +25 -0
- package/dist/mainPage/index.js.map +1 -0
- package/{lib → dist}/microblogPane/microblogPane.js +270 -270
- package/dist/microblogPane/microblogPane.js.map +1 -0
- package/dist/n3Pane.js +57 -0
- package/dist/n3Pane.js.map +1 -0
- package/{lib → dist}/outline/context.js +4 -4
- package/{lib → dist}/outline/context.js.map +1 -1
- package/dist/outline/manager.js +1997 -0
- package/dist/outline/manager.js.map +1 -0
- package/{lib → dist}/outline/outlineIcons.js +2 -3
- package/dist/outline/outlineIcons.js.map +1 -0
- package/{lib → dist}/outline/propertyViews.js +4 -4
- package/dist/outline/propertyViews.js.map +1 -0
- package/{lib → dist}/outline/queryByExample.js +33 -33
- package/dist/outline/queryByExample.js.map +1 -0
- package/{lib → dist}/outline/userInput.js +268 -266
- package/dist/outline/userInput.js.map +1 -0
- package/dist/outline/viewAsImage.js +15 -0
- package/dist/outline/viewAsImage.js.map +1 -0
- package/dist/outline/viewAsMbox.js +22 -0
- package/dist/outline/viewAsMbox.js.map +1 -0
- package/{lib → dist}/pad/padPane.js +90 -96
- package/dist/pad/padPane.js.map +1 -0
- package/{lib → dist}/playlist/playlistPane.js +36 -37
- package/dist/playlist/playlistPane.js.map +1 -0
- package/{lib → dist}/registerPanes.js +29 -29
- package/dist/registerPanes.js.map +1 -0
- package/{lib → dist}/schedule/schedulePane.js +171 -178
- package/dist/schedule/schedulePane.js.map +1 -0
- package/{lib → dist}/sharing/sharingPane.js +12 -12
- package/dist/sharing/sharingPane.js.map +1 -0
- package/dist/slideshow/slideshowPane.js +80 -0
- package/dist/slideshow/slideshowPane.js.map +1 -0
- package/{lib → dist}/socialPane.js +142 -142
- package/dist/socialPane.js.map +1 -0
- package/dist/tabbed/tabbedPane.js +58 -0
- package/dist/tabbed/tabbedPane.js.map +1 -0
- package/{lib → dist}/tableViewPane.js +8 -9
- package/dist/tableViewPane.js.map +1 -0
- package/{lib → dist}/transaction/pane.js +117 -118
- package/dist/transaction/pane.js.map +1 -0
- package/{lib → dist}/transaction/period.js +82 -83
- package/dist/transaction/period.js.map +1 -0
- package/{lib → dist}/trip/tripPane.js +47 -48
- package/dist/trip/tripPane.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.dom.js +146 -0
- package/dist/trustedApplications/trustedApplications.dom.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.utils.js +24 -0
- package/dist/trustedApplications/trustedApplications.utils.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.view.js +56 -0
- package/dist/trustedApplications/trustedApplications.view.js.map +1 -0
- package/{lib → dist}/ui/pane.js +30 -31
- package/dist/ui/pane.js.map +1 -0
- package/dist/versionInfo.js +37 -0
- package/dist/versionInfo.js.map +1 -0
- package/dist/video/videoPane.js +43 -0
- package/dist/video/videoPane.js.map +1 -0
- package/package.json +46 -40
- package/Documentation/VisualLanguage.html +0 -538
- package/Documentation/conventions.md +0 -333
- package/coverage/clover.xml +0 -152
- package/coverage/coverage-final.json +0 -6
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/outline/index.html +0 -161
- package/coverage/lcov-report/outline/outlineIcons.js.html +0 -565
- package/coverage/lcov-report/outline/propertyViews.ts.html +0 -196
- package/coverage/lcov-report/outline/viewAsImage.ts.html +0 -121
- package/coverage/lcov-report/outline/viewAsMbox.ts.html +0 -127
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/trustedApplications/index.html +0 -116
- package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +0 -238
- package/coverage/lcov.info +0 -204
- package/dev/index.html +0 -28
- package/dev/loader.ts +0 -91
- package/dev/pane/index.ts +0 -10
- package/doc/images/panes-for-classes.epgz +0 -0
- package/doc/images/panes-for-classes.svg +0 -609
- package/eslint.config.mjs +0 -34
- package/jest.config.js +0 -27
- package/jest.setup.ts +0 -4
- package/lib/RDFXMLPane.js +0 -59
- package/lib/RDFXMLPane.js.map +0 -1
- package/lib/argument/argumentPane.js.map +0 -1
- package/lib/attach/attachPane.js.map +0 -1
- package/lib/audio/audioPane.js.map +0 -1
- package/lib/classInstancePane.js.map +0 -1
- package/lib/dashboard/basicPreferences.js +0 -229
- package/lib/dashboard/basicPreferences.js.map +0 -1
- package/lib/dashboard/dashboardPane.js.map +0 -1
- package/lib/dashboard/homepage.js +0 -86
- package/lib/dashboard/homepage.js.map +0 -1
- package/lib/dataContentPane.js.map +0 -1
- package/lib/defaultPane.js.map +0 -1
- package/lib/dokieli/dokieliPane.js.map +0 -1
- package/lib/dokieli/new.js +0 -9
- package/lib/dokieli/new.js.map +0 -1
- package/lib/form/pane.js.map +0 -1
- package/lib/global.d.js +0 -2
- package/lib/global.d.js.map +0 -1
- package/lib/home/homePane.js +0 -91
- package/lib/home/homePane.js.map +0 -1
- package/lib/humanReadablePane.js +0 -138
- package/lib/humanReadablePane.js.map +0 -1
- package/lib/imagePane.js +0 -71
- package/lib/imagePane.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/internal/internalPane.js.map +0 -1
- package/lib/mainPage/header.js +0 -152
- package/lib/mainPage/header.js.map +0 -1
- package/lib/mainPage/index.js +0 -42
- package/lib/mainPage/index.js.map +0 -1
- package/lib/microblogPane/microblogPane.js.map +0 -1
- package/lib/n3Pane.js +0 -57
- package/lib/n3Pane.js.map +0 -1
- package/lib/outline/manager.js +0 -2264
- package/lib/outline/manager.js.map +0 -1
- package/lib/outline/manager.test.d.ts +0 -2
- package/lib/outline/manager.test.d.ts.map +0 -1
- package/lib/outline/manager.test.js +0 -210
- package/lib/outline/manager.test.js.map +0 -1
- package/lib/outline/outlineIcons.js.map +0 -1
- package/lib/outline/propertyViews.js.map +0 -1
- package/lib/outline/propertyViews.test.d.ts +0 -2
- package/lib/outline/propertyViews.test.d.ts.map +0 -1
- package/lib/outline/propertyViews.test.js +0 -27
- package/lib/outline/propertyViews.test.js.map +0 -1
- package/lib/outline/queryByExample.js.map +0 -1
- package/lib/outline/userInput.js.map +0 -1
- package/lib/outline/viewAsImage.js +0 -17
- package/lib/outline/viewAsImage.js.map +0 -1
- package/lib/outline/viewAsMbox.js +0 -23
- package/lib/outline/viewAsMbox.js.map +0 -1
- package/lib/pad/padPane.js.map +0 -1
- package/lib/playlist/playlistPane.js.map +0 -1
- package/lib/registerPanes.js.map +0 -1
- package/lib/schedule/formsForSchedule.js +0 -8
- package/lib/schedule/formsForSchedule.js.map +0 -1
- package/lib/schedule/schedulePane.js.map +0 -1
- package/lib/sharing/sharingPane.js.map +0 -1
- package/lib/slideshow/slideshowPane.js +0 -84
- package/lib/slideshow/slideshowPane.js.map +0 -1
- package/lib/socialPane.js.map +0 -1
- package/lib/tabbed/tabbedPane.js +0 -72
- package/lib/tabbed/tabbedPane.js.map +0 -1
- package/lib/tableViewPane.js.map +0 -1
- package/lib/test-import-export/common.js +0 -12
- package/lib/test-import-export/common.js.map +0 -1
- package/lib/test-import-export/edit-importer.js +0 -25
- package/lib/test-import-export/edit-importer.js.map +0 -1
- package/lib/test-import-export/testImportExport.js +0 -2
- package/lib/test-import-export/testImportExport.js.map +0 -1
- package/lib/transaction/pane.js.map +0 -1
- package/lib/transaction/period.js.map +0 -1
- package/lib/trip/tripPane.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.dom.js +0 -177
- package/lib/trustedApplications/trustedApplications.dom.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.test.d.ts +0 -2
- package/lib/trustedApplications/trustedApplications.test.d.ts.map +0 -1
- package/lib/trustedApplications/trustedApplications.test.js +0 -64
- package/lib/trustedApplications/trustedApplications.test.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.utils.js +0 -34
- package/lib/trustedApplications/trustedApplications.utils.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.view.js +0 -87
- package/lib/trustedApplications/trustedApplications.view.js.map +0 -1
- package/lib/types.d.ts +0 -30
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -6
- package/lib/types.js.map +0 -1
- package/lib/ui/pane.js.map +0 -1
- package/lib/versionInfo.d.ts +0 -32
- package/lib/versionInfo.d.ts.map +0 -1
- package/lib/versionInfo.js +0 -37
- package/lib/versionInfo.js.map +0 -1
- package/lib/video/videoPane.js +0 -44
- package/lib/video/videoPane.js.map +0 -1
- package/src/RDFXMLPane.js +0 -60
- package/src/argument/argumentPane.js +0 -65
- package/src/argument/argument_icon_v04.jpg +0 -0
- package/src/argument/icon_argument.png +0 -0
- package/src/argument/transparentyingyang.png +0 -0
- package/src/attach/attachPane.js +0 -508
- package/src/attach/tbl-paperclip-128.png +0 -0
- package/src/attach/tbl-paperclip-22.png +0 -0
- package/src/attach/tbl-paperclip-22a.png +0 -0
- package/src/audio/audioPane.js +0 -197
- package/src/chatPreferencesForm.ttl +0 -12
- package/src/classInstancePane.js +0 -110
- package/src/dashboard/basicPreferences.ts +0 -201
- package/src/dashboard/dashboardPane.ts +0 -83
- package/src/dashboard/homepage.ts +0 -72
- package/src/dashboard/languages/codes.html +0 -8611
- package/src/dashboard/languages/codes.xml +0 -3563
- package/src/dashboard/languages/codes2.txt +0 -170
- package/src/dashboard/languages/foo +0 -70
- package/src/dashboard/languages/foo.ttl +0 -0
- package/src/dashboard/languages/get-language-names.sh +0 -12
- package/src/dashboard/ontologyData.ttl +0 -35
- package/src/dashboard/preferencesFormText.ttl +0 -18
- package/src/dataContentPane.js +0 -290
- package/src/defaultPane.js +0 -102
- package/src/dokieli/Makefile +0 -6
- package/src/dokieli/dokieliPane.js +0 -190
- package/src/dokieli/new.html +0 -30
- package/src/form/form-22.png +0 -0
- package/src/form/form-b-22.png +0 -0
- package/src/form/form.graffle +0 -0
- package/src/form/form.png +0 -0
- package/src/form/pane.js +0 -217
- package/src/form/psuedocode-notes.txt +0 -57
- package/src/global.d.ts +0 -4
- package/src/home/homePane.ts +0 -72
- package/src/humanReadablePane.js +0 -150
- package/src/imagePane.js +0 -75
- package/src/index.ts +0 -71
- package/src/internal/internalPane.ts +0 -263
- package/src/mainPage/footer.ts +0 -19
- package/src/mainPage/header.ts +0 -79
- package/src/mainPage/index.ts +0 -20
- package/src/meeting/Makefile +0 -3
- package/src/meeting/test/meeting1/Actions/actions.ttl +0 -14
- package/src/meeting/test/meeting1/Actions/config.ttl +0 -16
- package/src/meeting/test/meeting1/Actions/state.ttl +0 -30
- package/src/meeting/test/meeting1/Schedule/details.ttl +0 -34
- package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -75
- package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/index.html +0 -72
- package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/results.ttl +0 -15
- package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -20
- package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -23
- package/src/meeting/test/meeting1/chat/chat.ttl +0 -1
- package/src/meeting/test/meeting1/details.ttl +0 -35
- package/src/meeting/test/meeting1/pad/pad.ttl +0 -16
- package/src/microblogPane/mbStyle.css +0 -267
- package/src/microblogPane/microblogPane.js +0 -1412
- package/src/n3Pane.js +0 -56
- package/src/outline/context.ts +0 -21
- package/src/outline/manager.js +0 -2384
- package/src/outline/manager.test.ts +0 -189
- package/src/outline/outlineIcons.js +0 -160
- package/src/outline/propertyViews.test.ts +0 -36
- package/src/outline/propertyViews.ts +0 -37
- package/src/outline/queryByExample.js +0 -296
- package/src/outline/userInput.js +0 -2373
- package/src/outline/viewAsImage.ts +0 -12
- package/src/outline/viewAsMbox.ts +0 -14
- package/src/pad/images/ColourOff.ai +2 -872
- package/src/pad/images/ColourOff.png +0 -0
- package/src/pad/images/ColourOn.ai +1 -935
- package/src/pad/images/ColourOn.png +0 -0
- package/src/pad/padPane.ts +0 -559
- package/src/playlist/playlistPane.js +0 -161
- package/src/registerPanes.js +0 -147
- package/src/schedule/Makefile +0 -6
- package/src/schedule/formsForSchedule.js +0 -117
- package/src/schedule/formsForSchedule.ttl +0 -115
- package/src/schedule/schedulePane.js +0 -1201
- package/src/sharing/sharingPane.ts +0 -49
- package/src/slideshow/slideshowPane.js +0 -80
- package/src/socialPane.js +0 -523
- package/src/style/tabbedtab.css +0 -1347
- package/src/tabbed/tabbedPane.ts +0 -60
- package/src/tableViewPane.js +0 -51
- package/src/test-import-export/common.js +0 -6
- package/src/test-import-export/edit-importer.js +0 -20
- package/src/test-import-export/testImportExport.js +0 -0
- package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
- package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/pane.js +0 -629
- package/src/transaction/period.js +0 -374
- package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
- package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
- package/src/trip/tripPane.js +0 -176
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -176
- package/src/trustedApplications/trustedApplications.dom.ts +0 -276
- package/src/trustedApplications/trustedApplications.test.ts +0 -82
- package/src/trustedApplications/trustedApplications.utils.ts +0 -51
- package/src/trustedApplications/trustedApplications.view.ts +0 -80
- package/src/types.ts +0 -34
- package/src/ui/22-builder.png +0 -0
- package/src/ui/builder.graffle +0 -0
- package/src/ui/builder.png +0 -0
- package/src/ui/builder2.png +0 -0
- package/src/ui/pane.js +0 -226
- package/src/versionInfo.ts +0 -30
- package/src/video/videoPane.js +0 -44
- package/timestamp.sh +0 -13
- package/travis/bumpversion.js +0 -29
- package/tsconfig.json +0 -78
- package/typings/raw-loader.d.ts +0 -4
- package/typings/solid-namespace/index.d.ts +0 -9
- package/webpack.config.js +0 -41
- /package/{lib → dist}/dashboard/basicPreferences.d.ts +0 -0
- /package/{lib → dist}/dashboard/basicPreferences.d.ts.map +0 -0
- /package/{lib → dist}/dashboard/dashboardPane.d.ts +0 -0
- /package/{lib → dist}/dashboard/dashboardPane.d.ts.map +0 -0
- /package/{lib → dist}/dashboard/homepage.d.ts +0 -0
- /package/{lib → dist}/dashboard/homepage.d.ts.map +0 -0
- /package/{lib → dist}/home/homePane.d.ts +0 -0
- /package/{lib → dist}/home/homePane.d.ts.map +0 -0
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/index.d.ts.map +0 -0
- /package/{lib → dist}/internal/internalPane.d.ts +0 -0
- /package/{lib → dist}/internal/internalPane.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/footer.d.ts +0 -0
- /package/{lib → dist}/mainPage/footer.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/header.d.ts +0 -0
- /package/{lib → dist}/mainPage/header.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/index.d.ts +0 -0
- /package/{lib → dist}/outline/context.d.ts +0 -0
- /package/{lib → dist}/outline/context.d.ts.map +0 -0
- /package/{lib → dist}/outline/propertyViews.d.ts +0 -0
- /package/{lib → dist}/outline/propertyViews.d.ts.map +0 -0
- /package/{lib → dist}/outline/viewAsImage.d.ts +0 -0
- /package/{lib → dist}/outline/viewAsImage.d.ts.map +0 -0
- /package/{lib → dist}/outline/viewAsMbox.d.ts +0 -0
- /package/{lib → dist}/outline/viewAsMbox.d.ts.map +0 -0
- /package/{lib → dist}/pad/padPane.d.ts +0 -0
- /package/{lib → dist}/pad/padPane.d.ts.map +0 -0
- /package/{lib → dist}/sharing/sharingPane.d.ts +0 -0
- /package/{lib → dist}/sharing/sharingPane.d.ts.map +0 -0
- /package/{lib → dist}/tabbed/tabbedPane.d.ts +0 -0
- /package/{lib → dist}/tabbed/tabbedPane.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts.map +0 -0
package/src/audio/audioPane.js
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
/* Single audio play Pane
|
|
2
|
-
**
|
|
3
|
-
*/
|
|
4
|
-
import * as UI from 'solid-ui'
|
|
5
|
-
import * as $rdf from 'rdflib'
|
|
6
|
-
const ns = UI.ns
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
icon: UI.icons.iconBase + 'noun_534313.svg',
|
|
10
|
-
|
|
11
|
-
name: 'audio',
|
|
12
|
-
|
|
13
|
-
// Does the subject deserve an audio play pane?
|
|
14
|
-
label: function (subject, context) {
|
|
15
|
-
const kb = context.session.store
|
|
16
|
-
const typeURIs = kb.findTypeURIs(subject)
|
|
17
|
-
|
|
18
|
-
const prefix = $rdf.Util.mediaTypeClass('audio/*').uri.split('*')[0]
|
|
19
|
-
for (const t in typeURIs) {
|
|
20
|
-
if (t.startsWith(prefix)) return 'Play audio'
|
|
21
|
-
}
|
|
22
|
-
return null
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
render: function (subject, context) {
|
|
26
|
-
const kb = context.session.store
|
|
27
|
-
const dom = context.dom
|
|
28
|
-
const options = {
|
|
29
|
-
autoplay: false,
|
|
30
|
-
chain: true,
|
|
31
|
-
chainAlbums: true,
|
|
32
|
-
loop: false
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const removeExtension = function (str) {
|
|
36
|
-
const dot = str.lastIndexOf('.')
|
|
37
|
-
if (dot < 0) return str // if any
|
|
38
|
-
const slash = str.lastIndexOf('/')
|
|
39
|
-
if (dot < slash) return str
|
|
40
|
-
return str.slice(0, dot)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// True if there is another file like song.mp3 when this is "song 1.mp3"
|
|
44
|
-
// or this is song.m4a
|
|
45
|
-
//
|
|
46
|
-
const looksRedundant = function (x) {
|
|
47
|
-
const folder = kb.any(undefined, ns.ldp('contains'), x)
|
|
48
|
-
if (!folder) return false
|
|
49
|
-
const contents = kb.each(folder, ns.ldp('contains'))
|
|
50
|
-
if (contents.length < 2) return false
|
|
51
|
-
const thisName = x.uri
|
|
52
|
-
for (let k = 0; k < contents.length; k++) {
|
|
53
|
-
const otherName = contents[k].uri
|
|
54
|
-
if (
|
|
55
|
-
thisName.length > otherName.length &&
|
|
56
|
-
thisName.startsWith(removeExtension(otherName))
|
|
57
|
-
) {
|
|
58
|
-
return true
|
|
59
|
-
}
|
|
60
|
-
if (
|
|
61
|
-
thisName.endsWith('.m4a') &&
|
|
62
|
-
otherName.endsWith('.mp3') &&
|
|
63
|
-
removeExtension(thisName) === removeExtension(otherName)
|
|
64
|
-
) {
|
|
65
|
-
return true
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return false
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Alternative methods could include:
|
|
72
|
-
// Accesing metadata in the audio contol, or paring the audio file
|
|
73
|
-
const guessNames = function (x) {
|
|
74
|
-
const a = x.uri.split('/').slice(-3) // Hope artist, album, track
|
|
75
|
-
const decode = function (str) {
|
|
76
|
-
try {
|
|
77
|
-
return decodeURIComponent(str)
|
|
78
|
-
} catch (e) {
|
|
79
|
-
return str
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
artistRow.textContent = decode(a[0])
|
|
83
|
-
albumRow.textContent = decode(a[1])
|
|
84
|
-
trackRow.textContent = decode(removeExtension(a[2]))
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const moveOn = function (current, level) {
|
|
88
|
-
return new Promise(function (resolve) {
|
|
89
|
-
level = level || 0
|
|
90
|
-
if (!options.chain) return resolve(null)
|
|
91
|
-
// Ideally navigate graph else cheat with URI munging:
|
|
92
|
-
const folder =
|
|
93
|
-
kb.any(undefined, ns.ldp('contains'), current) || current.dir()
|
|
94
|
-
if (!folder) return resolve(null)
|
|
95
|
-
kb.fetcher.load(folder).then(function (_xhr) {
|
|
96
|
-
const contents = kb.each(folder, ns.ldp('contains')) // @@ load if not loaded
|
|
97
|
-
// if (contents.length < 2) return resolve(null) NO might move on from 1-track album
|
|
98
|
-
let j
|
|
99
|
-
contents.sort() // sort by URI which hopefully will get tracks in order
|
|
100
|
-
for (let i = 0; i < contents.length; i++) {
|
|
101
|
-
if (current.uri === contents[i].uri) {
|
|
102
|
-
j = (i + 1) % contents.length
|
|
103
|
-
if (j === 0) {
|
|
104
|
-
if (!options.chainAlbums) {
|
|
105
|
-
if (options.loop) {
|
|
106
|
-
return resolve(contents[j])
|
|
107
|
-
}
|
|
108
|
-
return resolve(null) // No more music needed
|
|
109
|
-
} else {
|
|
110
|
-
// chain albums
|
|
111
|
-
if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee
|
|
112
|
-
moveOn(folder, level + 1).then(function (folder2) {
|
|
113
|
-
if (folder2) {
|
|
114
|
-
kb.fetcher.load(folder2).then(function (_xhr) {
|
|
115
|
-
const contents = kb.each(folder2, ns.ldp('contains'))
|
|
116
|
-
if (contents.length === 0) return resolve(null)
|
|
117
|
-
contents.sort()
|
|
118
|
-
console.log('New Album: ' + folder2)
|
|
119
|
-
return resolve(contents[0]) // Start off new album
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
}
|
|
124
|
-
} else {
|
|
125
|
-
return resolve(contents[j])
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
} // for
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
}
|
|
132
|
-
const endedListener = function (event) {
|
|
133
|
-
const current = kb.sym(event.target.getAttribute('src'))
|
|
134
|
-
if (!options.chain) return
|
|
135
|
-
const tryNext = function (cur) {
|
|
136
|
-
const current = cur
|
|
137
|
-
moveOn(current).then(function (next) {
|
|
138
|
-
if (!next) {
|
|
139
|
-
console.log('No successor to ' + current)
|
|
140
|
-
return
|
|
141
|
-
}
|
|
142
|
-
if (!looksRedundant(next)) {
|
|
143
|
-
console.log('Moving on to ' + next)
|
|
144
|
-
guessNames(next)
|
|
145
|
-
controlRow.appendChild(audioControl(next, true)) // Force autoplay
|
|
146
|
-
controlRow.removeChild(event.target)
|
|
147
|
-
} else {
|
|
148
|
-
console.log('Ignoring redundant ' + next)
|
|
149
|
-
tryNext(next)
|
|
150
|
-
}
|
|
151
|
-
})
|
|
152
|
-
}
|
|
153
|
-
tryNext(current)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const audioControl = function (song, autoplay) {
|
|
157
|
-
const audio = dom.createElement('audio')
|
|
158
|
-
audio.setAttribute('controls', 'yes')
|
|
159
|
-
// get audio with authenticated fetch
|
|
160
|
-
kb.fetcher._fetch(song.uri)
|
|
161
|
-
.then(function(response) {
|
|
162
|
-
return response.blob()
|
|
163
|
-
})
|
|
164
|
-
.then(function(myBlob) {
|
|
165
|
-
const objectURL = URL.createObjectURL(myBlob)
|
|
166
|
-
audio.setAttribute('src', objectURL) // w640 h480 //
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
if (autoplay) {
|
|
170
|
-
audio.setAttribute('autoplay', 'autoplay') // Make this a personal preference
|
|
171
|
-
}
|
|
172
|
-
audio.addEventListener('ended', endedListener, false)
|
|
173
|
-
return audio
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const div = dom.createElement('div')
|
|
177
|
-
const table = div.appendChild(dom.createElement('table'))
|
|
178
|
-
const labelStyle = 'padding: 0.3em; color:white; background-color: black;'
|
|
179
|
-
const artistRow = table.appendChild(dom.createElement('tr'))
|
|
180
|
-
artistRow.style.cssText = labelStyle
|
|
181
|
-
const albumRow = table.appendChild(dom.createElement('tr'))
|
|
182
|
-
albumRow.style.cssText = labelStyle
|
|
183
|
-
const trackRow = table.appendChild(dom.createElement('tr'))
|
|
184
|
-
trackRow.style.cssText = labelStyle
|
|
185
|
-
const controlRow = table.appendChild(dom.createElement('tr'))
|
|
186
|
-
guessNames(subject)
|
|
187
|
-
controlRow.appendChild(audioControl(subject, options.autoplay))
|
|
188
|
-
|
|
189
|
-
if (!kb.holds(undefined, ns.ldp('contains'), subject) && subject.dir()) {
|
|
190
|
-
kb.fetcher.load(subject.dir()) // Prefetch enclosing @@ or playlist
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return div
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// ends
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
|
|
2
|
-
@prefix ui: <http://www.w3.org/ns/ui#>.
|
|
3
|
-
@prefix : <#>.
|
|
4
|
-
|
|
5
|
-
:this
|
|
6
|
-
<http://purl.org/dc/elements/1.1/title> "Chat preferences" ;
|
|
7
|
-
a ui:Form ;
|
|
8
|
-
ui:part :colorizeField;
|
|
9
|
-
ui:parts ( :colorizeField :expandImagesInline ).
|
|
10
|
-
|
|
11
|
-
:colorizeField a ui:BooleanField; ui:label "Color user input by user".
|
|
12
|
-
:expandImagesInline a ui:BooleanField; ui:label "Expand image URLs inline".
|
package/src/classInstancePane.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/* Class member Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane lists the members of a class
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import * as UI from 'solid-ui'
|
|
7
|
-
import * as $rdf from 'rdflib'
|
|
8
|
-
|
|
9
|
-
const ns = UI.ns
|
|
10
|
-
|
|
11
|
-
export const classInstancePane = {
|
|
12
|
-
icon: UI.icons.originalIconBase + 'tango/22-folder-open.png',
|
|
13
|
-
|
|
14
|
-
name: 'classInstance',
|
|
15
|
-
|
|
16
|
-
// Create a new folder in a Solid system,
|
|
17
|
-
|
|
18
|
-
audience: [ns.solid('PowerUser')],
|
|
19
|
-
|
|
20
|
-
label: function (subject, context) {
|
|
21
|
-
const kb = context.session.store
|
|
22
|
-
const n = kb.each(undefined, ns.rdf('type'), subject).length
|
|
23
|
-
if (n > 0) return 'List (' + n + ')' // Show how many in hover text
|
|
24
|
-
return null // Suppress pane otherwise
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
render: function (subject, context) {
|
|
28
|
-
const dom = context.dom
|
|
29
|
-
const outliner = context.getOutliner(dom)
|
|
30
|
-
const kb = context.session.store
|
|
31
|
-
const complain = function complain (message, color) {
|
|
32
|
-
const pre = dom.createElement('pre')
|
|
33
|
-
pre.setAttribute('style', 'background-color: ' + color || '#eed' + ';')
|
|
34
|
-
div.appendChild(pre)
|
|
35
|
-
pre.appendChild(dom.createTextNode(message))
|
|
36
|
-
}
|
|
37
|
-
const div = dom.createElement('div')
|
|
38
|
-
div.setAttribute('class', 'instancePane')
|
|
39
|
-
div.setAttribute(
|
|
40
|
-
'style',
|
|
41
|
-
' border-top: solid 1px #777; border-bottom: solid 1px #777; margin-top: 0.5em; margin-bottom: 0.5em '
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
// If this is a class, look for all both explicit and implicit
|
|
45
|
-
const sts = kb.statementsMatching(undefined, ns.rdf('type'), subject)
|
|
46
|
-
if (sts.length > 0) {
|
|
47
|
-
const already = {}
|
|
48
|
-
const more = []
|
|
49
|
-
sts.forEach(st => {
|
|
50
|
-
already[st.subject.toNT()] = st
|
|
51
|
-
})
|
|
52
|
-
for (const nt in kb.findMembersNT(subject)) {
|
|
53
|
-
if (!already[nt]) {
|
|
54
|
-
more.push($rdf.st(kb.fromNT(nt), ns.rdf('type'), subject)) // @@ no provenance
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (more.length) {
|
|
58
|
-
complain(
|
|
59
|
-
'There are ' +
|
|
60
|
-
sts.length +
|
|
61
|
-
' explicit and ' +
|
|
62
|
-
more.length +
|
|
63
|
-
' implicit members of ' +
|
|
64
|
-
UI.utils.label(subject)
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
if (subject.sameTerm(ns.rdf('Property'))) {
|
|
68
|
-
// / Do not find all properties used as properties .. unless look at kb index
|
|
69
|
-
} else if (subject.sameTerm(ns.rdfs('Class'))) {
|
|
70
|
-
const uses = kb.statementsMatching(undefined, ns.rdf('type'), undefined)
|
|
71
|
-
const usedTypes = {}
|
|
72
|
-
uses.forEach(function (st) {
|
|
73
|
-
usedTypes[st.object] = st
|
|
74
|
-
}) // Get unique
|
|
75
|
-
const used = []
|
|
76
|
-
for (const i in usedTypes) {
|
|
77
|
-
used.push($rdf.st($rdf.sym(i), ns.rdf('type'), ns.rdfs('Class')))
|
|
78
|
-
}
|
|
79
|
-
complain(
|
|
80
|
-
'Total of ' +
|
|
81
|
-
uses.length +
|
|
82
|
-
' type statements and ' +
|
|
83
|
-
used.length +
|
|
84
|
-
' unique types.'
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (sts.length > 10) {
|
|
89
|
-
const tr = dom.createElement('TR')
|
|
90
|
-
tr.appendChild(dom.createTextNode('' + sts.length))
|
|
91
|
-
// tr.AJAR_statement=sts[i]
|
|
92
|
-
div.appendChild(tr)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
outliner.appendPropertyTRs(div, sts, true, function (_pred) {
|
|
96
|
-
return true
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
if (more.length) {
|
|
100
|
-
complain('Implicit:')
|
|
101
|
-
outliner.appendPropertyTRs(div, more, true, function (_pred) {
|
|
102
|
-
return true
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return div
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// ends
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { PaneDefinition } from 'pane-registry'
|
|
2
|
-
import { IndexedFormula, NamedNode, parse, Store } from 'rdflib'
|
|
3
|
-
import { icons, login, ns, widgets } from 'solid-ui'
|
|
4
|
-
import ontologyData from './ontologyData.ttl'
|
|
5
|
-
import preferencesFormText from './preferencesFormText.ttl'
|
|
6
|
-
|
|
7
|
-
export const basicPreferencesPane: PaneDefinition = {
|
|
8
|
-
icon: icons.iconBase + 'noun_Sliders_341315_000000.svg',
|
|
9
|
-
name: 'basicPreferences',
|
|
10
|
-
label: _subject => {
|
|
11
|
-
return null
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
// Render the pane
|
|
15
|
-
// The subject should be the logged in user.
|
|
16
|
-
render: (subject, context) => {
|
|
17
|
-
const dom = context.dom
|
|
18
|
-
const store = context.session.store as Store
|
|
19
|
-
|
|
20
|
-
function complainIfBad (ok: Boolean, mess: any) {
|
|
21
|
-
if (ok) return
|
|
22
|
-
container.appendChild(widgets.errorMessageBlock(dom, mess, '#fee'))
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const container = dom.createElement('div')
|
|
26
|
-
|
|
27
|
-
const formArea = setupUserTypesSection(container, dom)
|
|
28
|
-
|
|
29
|
-
function loadData (doc: NamedNode, turtle: String) {
|
|
30
|
-
doc = doc.doc() // remove # from URI if nec
|
|
31
|
-
if (!store.holds(undefined, undefined, undefined, doc)) {
|
|
32
|
-
// If not loaded already
|
|
33
|
-
;(parse as any)(turtle, store, doc.uri, 'text/turtle', null) // Load form directly
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const preferencesForm = store.sym(
|
|
38
|
-
'urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597#this'
|
|
39
|
-
)
|
|
40
|
-
loadData(preferencesForm, preferencesFormText)
|
|
41
|
-
|
|
42
|
-
const ontologyExtra = store.sym(
|
|
43
|
-
'urn:uuid:93774ba1-d3b6-41f2-85b6-4ae27ffd2597-ONT'
|
|
44
|
-
)
|
|
45
|
-
loadData(ontologyExtra, ontologyData)
|
|
46
|
-
|
|
47
|
-
async function doRender () {
|
|
48
|
-
const renderContext = await login.ensureLoadedPreferences({
|
|
49
|
-
dom,
|
|
50
|
-
div: container
|
|
51
|
-
})
|
|
52
|
-
if (!renderContext.preferencesFile) {
|
|
53
|
-
// Could be CORS
|
|
54
|
-
console.log(
|
|
55
|
-
'Not doing private class preferences as no access to preferences file. ' +
|
|
56
|
-
renderContext.preferencesFileError
|
|
57
|
-
)
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
const appendedForm = widgets.appendForm(
|
|
61
|
-
dom,
|
|
62
|
-
formArea,
|
|
63
|
-
{},
|
|
64
|
-
renderContext.me,
|
|
65
|
-
preferencesForm,
|
|
66
|
-
renderContext.preferencesFile,
|
|
67
|
-
complainIfBad
|
|
68
|
-
)
|
|
69
|
-
appendedForm.style.borderStyle = 'none'
|
|
70
|
-
|
|
71
|
-
const trustedApplicationsView = context.session.paneRegistry.byName('trustedApplications')
|
|
72
|
-
if (trustedApplicationsView) {
|
|
73
|
-
container.appendChild(trustedApplicationsView.render(null, context))
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// @@ TODO Remove need for casting as any and bang (!) syntax
|
|
77
|
-
addDeleteSection(container, store, renderContext.me!, dom)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
doRender()
|
|
81
|
-
|
|
82
|
-
return container
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function setupUserTypesSection (
|
|
87
|
-
container: Element,
|
|
88
|
-
dom: HTMLDocument
|
|
89
|
-
): Element {
|
|
90
|
-
const formContainer = createSection(container, dom, 'User types')
|
|
91
|
-
|
|
92
|
-
const description = formContainer.appendChild(dom.createElement('p'))
|
|
93
|
-
description.innerText = 'Here you can self-assign user types to help the data browser know which views you would like to access.'
|
|
94
|
-
|
|
95
|
-
const userTypesLink = formContainer.appendChild(dom.createElement('a'))
|
|
96
|
-
userTypesLink.href = 'https://github.com/solidos/userguide/#role'
|
|
97
|
-
userTypesLink.innerText = 'Read more'
|
|
98
|
-
|
|
99
|
-
const formArea = formContainer.appendChild(dom.createElement('div'))
|
|
100
|
-
|
|
101
|
-
return formArea
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export default basicPreferencesPane
|
|
105
|
-
|
|
106
|
-
// ends
|
|
107
|
-
|
|
108
|
-
function addDeleteSection (
|
|
109
|
-
container: HTMLElement,
|
|
110
|
-
store: IndexedFormula,
|
|
111
|
-
profile: NamedNode,
|
|
112
|
-
dom: HTMLDocument
|
|
113
|
-
): void {
|
|
114
|
-
const section = createSection(container, dom, 'Delete account')
|
|
115
|
-
|
|
116
|
-
const podServerNodes = store.each(profile, ns.space('storage'), null, profile.doc())
|
|
117
|
-
const podServers = podServerNodes.map(node => node.value)
|
|
118
|
-
|
|
119
|
-
const list = section.appendChild(dom.createElement('ul'))
|
|
120
|
-
|
|
121
|
-
podServers.forEach(async server => {
|
|
122
|
-
const deletionLink = await generateDeletionLink(server, dom)
|
|
123
|
-
if (deletionLink) {
|
|
124
|
-
const listItem = list.appendChild(dom.createElement('li'))
|
|
125
|
-
listItem.appendChild(deletionLink)
|
|
126
|
-
}
|
|
127
|
-
})
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
async function generateDeletionLink (
|
|
131
|
-
podServer: string,
|
|
132
|
-
dom: HTMLDocument
|
|
133
|
-
): Promise<HTMLElement | null> {
|
|
134
|
-
const link = dom.createElement('a')
|
|
135
|
-
link.textContent = `Delete your account at ${podServer}`
|
|
136
|
-
const deletionUrl = await getDeletionUrlForServer(podServer)
|
|
137
|
-
if (typeof deletionUrl !== 'string') {
|
|
138
|
-
return null
|
|
139
|
-
}
|
|
140
|
-
link.href = deletionUrl
|
|
141
|
-
return link
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Hacky way to get the deletion link to a Pod
|
|
146
|
-
*
|
|
147
|
-
* This function infers the deletion link by assuming the URL structure of Node Solid server.
|
|
148
|
-
* In the future, Solid will hopefully provide a standardised way of discovering the deletion link:
|
|
149
|
-
* https://github.com/solidos/data-interoperability-panel/issues/18
|
|
150
|
-
*
|
|
151
|
-
* If NSS is in multi-user mode (the case on inrupt.net and solid.community), the deletion URL for
|
|
152
|
-
* vincent.dev.inrupt.net would be at dev.inrupt.net/account/delete. In single-user mode, the
|
|
153
|
-
* deletion URL would be at vincent.dev.inrupt.net/account/delete.
|
|
154
|
-
*
|
|
155
|
-
* @param server Pod server containing the user's account.
|
|
156
|
-
* @returns URL of the page that Node Solid Server would offer to delete the account, or null if
|
|
157
|
-
* the URLs we tried give invalid responses.
|
|
158
|
-
*/
|
|
159
|
-
async function getDeletionUrlForServer (
|
|
160
|
-
server: string
|
|
161
|
-
): Promise<string | null> {
|
|
162
|
-
const singleUserUrl = new URL(server)
|
|
163
|
-
const multiUserUrl = new URL(server)
|
|
164
|
-
multiUserUrl.pathname = singleUserUrl.pathname = '/account/delete'
|
|
165
|
-
|
|
166
|
-
const hostnameParts = multiUserUrl.hostname.split('.')
|
|
167
|
-
// Remove `vincent.` from `vincent.dev.inrupt.net`, for example:
|
|
168
|
-
multiUserUrl.hostname = hostnameParts.slice(1).join('.')
|
|
169
|
-
|
|
170
|
-
const multiUserNssResponse = await fetch(multiUserUrl.href, {
|
|
171
|
-
method: 'HEAD'
|
|
172
|
-
})
|
|
173
|
-
if (multiUserNssResponse.ok) {
|
|
174
|
-
return multiUserUrl.href
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const singleUserNssResponse = await fetch(singleUserUrl.href, {
|
|
178
|
-
method: 'HEAD'
|
|
179
|
-
})
|
|
180
|
-
if (singleUserNssResponse.ok) {
|
|
181
|
-
return singleUserUrl.href
|
|
182
|
-
}
|
|
183
|
-
return null
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function createSection (
|
|
187
|
-
container: Element,
|
|
188
|
-
dom: HTMLDocument,
|
|
189
|
-
title: string
|
|
190
|
-
): Element {
|
|
191
|
-
const section = container.appendChild(dom.createElement('div'))
|
|
192
|
-
section.style.border = '0.3em solid #418d99'
|
|
193
|
-
section.style.borderRadius = '0.5em'
|
|
194
|
-
section.style.padding = '0.7em'
|
|
195
|
-
section.style.marginTop = '0.7em'
|
|
196
|
-
|
|
197
|
-
const titleElement = section.appendChild(dom.createElement('h3'))
|
|
198
|
-
titleElement.innerText = title
|
|
199
|
-
|
|
200
|
-
return section
|
|
201
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { icons } from 'solid-ui'
|
|
2
|
-
import { authn, authSession, store } from 'solid-logic'
|
|
3
|
-
import { Fetcher, NamedNode } from 'rdflib'
|
|
4
|
-
import { generateHomepage } from './homepage'
|
|
5
|
-
import { DataBrowserContext, PaneDefinition } from 'pane-registry'
|
|
6
|
-
|
|
7
|
-
export const dashboardPane: PaneDefinition = {
|
|
8
|
-
icon: icons.iconBase + 'noun_547570.svg',
|
|
9
|
-
name: 'dashboard',
|
|
10
|
-
label: subject => {
|
|
11
|
-
console.log()
|
|
12
|
-
if (subject.uri === subject.site().uri) {
|
|
13
|
-
return 'Dashboard'
|
|
14
|
-
}
|
|
15
|
-
return null
|
|
16
|
-
},
|
|
17
|
-
render: (subject, context) => {
|
|
18
|
-
console.log('Dashboard Pane Render')
|
|
19
|
-
const dom = context.dom
|
|
20
|
-
const container = dom.createElement('div')
|
|
21
|
-
const runBuildPage = () => {
|
|
22
|
-
container.innerHTML = ''
|
|
23
|
-
buildPage(
|
|
24
|
-
container,
|
|
25
|
-
authn.currentUser() || null,
|
|
26
|
-
context,
|
|
27
|
-
subject
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
authSession.events.on("login", () => {
|
|
32
|
-
// console.log('On Login')
|
|
33
|
-
runBuildPage()
|
|
34
|
-
})
|
|
35
|
-
authSession.events.on("sessionRestore", () => {
|
|
36
|
-
// console.log('On Session Restore')
|
|
37
|
-
runBuildPage()
|
|
38
|
-
})
|
|
39
|
-
// console.log('Initial Load')
|
|
40
|
-
runBuildPage()
|
|
41
|
-
|
|
42
|
-
return container
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function buildPage (
|
|
47
|
-
container: HTMLElement,
|
|
48
|
-
webId: NamedNode | null,
|
|
49
|
-
context: DataBrowserContext,
|
|
50
|
-
subject: NamedNode
|
|
51
|
-
) {
|
|
52
|
-
// if uri then SolidOS is a browse.html web app
|
|
53
|
-
const uri = (new URL(window.location.href)).searchParams.get('uri')
|
|
54
|
-
if (webId && (uri || webId.site().uri === subject.site().uri)) {
|
|
55
|
-
return buildDashboard(container, context)
|
|
56
|
-
}
|
|
57
|
-
return buildHomePage(container, subject)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function buildDashboard (container: HTMLElement, context: DataBrowserContext) {
|
|
61
|
-
// console.log('build dashboard')
|
|
62
|
-
// @@ TODO get a proper type
|
|
63
|
-
const outliner: any = context.getOutliner(context.dom)
|
|
64
|
-
outliner
|
|
65
|
-
.getDashboard()
|
|
66
|
-
.then((dashboard: HTMLElement) => container.appendChild(dashboard))
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function buildHomePage (container: HTMLElement, subject: NamedNode) {
|
|
70
|
-
// console.log('build home page')
|
|
71
|
-
const wrapper = document.createElement('div')
|
|
72
|
-
container.appendChild(wrapper)
|
|
73
|
-
const shadow = wrapper.attachShadow({ mode: 'open' })
|
|
74
|
-
const link = document.createElement('link')
|
|
75
|
-
link.rel = 'stylesheet'
|
|
76
|
-
link.href = '/common/css/bootstrap.min.css'
|
|
77
|
-
shadow.appendChild(link)
|
|
78
|
-
generateHomepage(subject, store, store.fetcher as Fetcher).then(homepage =>
|
|
79
|
-
shadow.appendChild(homepage)
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export default dashboardPane
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Fetcher, IndexedFormula, NamedNode, sym } from 'rdflib'
|
|
2
|
-
import { ns } from 'solid-ui'
|
|
3
|
-
|
|
4
|
-
export async function generateHomepage (
|
|
5
|
-
subject: NamedNode,
|
|
6
|
-
store: IndexedFormula,
|
|
7
|
-
fetcher: Fetcher
|
|
8
|
-
): Promise<HTMLElement> {
|
|
9
|
-
const ownersProfile = await loadProfile(subject, fetcher)
|
|
10
|
-
const name = getName(store, ownersProfile)
|
|
11
|
-
|
|
12
|
-
const wrapper = document.createElement('div')
|
|
13
|
-
wrapper.classList.add('container')
|
|
14
|
-
wrapper.appendChild(createTitle(ownersProfile.uri, name))
|
|
15
|
-
wrapper.appendChild(createDataSection(name))
|
|
16
|
-
|
|
17
|
-
return wrapper
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function createDataSection (name: string): HTMLElement {
|
|
21
|
-
const dataSection = document.createElement('section')
|
|
22
|
-
|
|
23
|
-
const title = document.createElement('h2')
|
|
24
|
-
title.innerText = 'Data'
|
|
25
|
-
dataSection.appendChild(title)
|
|
26
|
-
|
|
27
|
-
const listGroup = document.createElement('div')
|
|
28
|
-
listGroup.classList.add('list-group')
|
|
29
|
-
dataSection.appendChild(listGroup)
|
|
30
|
-
|
|
31
|
-
const publicDataLink = document.createElement('a')
|
|
32
|
-
publicDataLink.classList.add('list-group-item')
|
|
33
|
-
publicDataLink.href = window.document.location.href + 'public/'
|
|
34
|
-
publicDataLink.innerText = `View ${name}'s files`
|
|
35
|
-
listGroup.appendChild(publicDataLink)
|
|
36
|
-
|
|
37
|
-
return dataSection
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function createTitle (uri: string, name: string): HTMLElement {
|
|
41
|
-
const profileLink = document.createElement('a')
|
|
42
|
-
profileLink.href = uri
|
|
43
|
-
profileLink.innerText = name
|
|
44
|
-
|
|
45
|
-
const profileLinkPost = document.createElement('span')
|
|
46
|
-
profileLinkPost.innerText = '\'s Pod'
|
|
47
|
-
|
|
48
|
-
const title = document.createElement('h1')
|
|
49
|
-
title.appendChild(profileLink)
|
|
50
|
-
title.appendChild(profileLinkPost)
|
|
51
|
-
|
|
52
|
-
return title
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function loadProfile (
|
|
56
|
-
subject: NamedNode,
|
|
57
|
-
fetcher: Fetcher
|
|
58
|
-
): Promise<NamedNode> {
|
|
59
|
-
const pod = subject.site().uri
|
|
60
|
-
// TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now
|
|
61
|
-
const webId = sym(`${pod}profile/card#me`)
|
|
62
|
-
await fetcher.load(webId)
|
|
63
|
-
return webId
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getName (store: IndexedFormula, ownersProfile: NamedNode): string {
|
|
67
|
-
return (
|
|
68
|
-
store.anyValue(ownersProfile, ns.vcard('fn'), null, ownersProfile.doc()) ||
|
|
69
|
-
store.anyValue(ownersProfile, ns.foaf('name'), null, ownersProfile.doc()) ||
|
|
70
|
-
new URL(ownersProfile.uri).host.split('.')[0]
|
|
71
|
-
)
|
|
72
|
-
}
|