solid-panes 3.7.3 → 4.0.0-32da9eb1
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 +47 -41
- 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/humanReadablePane.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/* Human-readable Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane contains the document contents for an HTML document
|
|
4
|
-
** This is for peeking at a page, because the user might not want to leave the data browser.
|
|
5
|
-
*/
|
|
6
|
-
import { icons, ns } from 'solid-ui'
|
|
7
|
-
import { Util } from 'rdflib'
|
|
8
|
-
import { marked } from 'marked'
|
|
9
|
-
import DOMPurify from 'dompurify';
|
|
10
|
-
|
|
11
|
-
const humanReadablePane = {
|
|
12
|
-
icon: icons.originalIconBase + 'tango/22-text-x-generic.png',
|
|
13
|
-
|
|
14
|
-
name: 'humanReadable',
|
|
15
|
-
|
|
16
|
-
label: function (subject, context) {
|
|
17
|
-
const kb = context.session.store
|
|
18
|
-
|
|
19
|
-
// See also the source pane, which has lower precedence.
|
|
20
|
-
|
|
21
|
-
const allowed = [
|
|
22
|
-
'text/plain',
|
|
23
|
-
'text/html',
|
|
24
|
-
'text/markdown',
|
|
25
|
-
'application/xhtml+xml',
|
|
26
|
-
'image/png',
|
|
27
|
-
'image/jpeg',
|
|
28
|
-
'application/pdf',
|
|
29
|
-
'video/mp4'
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
const hasContentTypeIn = function (kb, x, displayables) {
|
|
33
|
-
const cts = kb.fetcher.getHeader(x, 'content-type')
|
|
34
|
-
if (cts) {
|
|
35
|
-
for (let j = 0; j < cts.length; j++) {
|
|
36
|
-
for (let k = 0; k < displayables.length; k++) {
|
|
37
|
-
if (cts[j].indexOf(displayables[k]) >= 0) {
|
|
38
|
-
return true
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return false
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// This data could come from a fetch OR from ldp container
|
|
47
|
-
const hasContentTypeIn2 = function (kb, x, displayables) {
|
|
48
|
-
const t = kb.findTypeURIs(x)
|
|
49
|
-
for (let k = 0; k < displayables.length; k++) {
|
|
50
|
-
if (Util.mediaTypeClass(displayables[k]).uri in t) {
|
|
51
|
-
return true
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return false
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (!subject.uri) return null // no bnodes
|
|
58
|
-
|
|
59
|
-
const t = kb.findTypeURIs(subject)
|
|
60
|
-
if (t[ns.link('WebPage').uri]) return 'view'
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
hasContentTypeIn(kb, subject, allowed) ||
|
|
64
|
-
hasContentTypeIn2(kb, subject, allowed)
|
|
65
|
-
) {
|
|
66
|
-
return 'View'
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return null
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
render: function (subject, context) {
|
|
73
|
-
const myDocument = context.dom
|
|
74
|
-
const div = myDocument.createElement('div')
|
|
75
|
-
const kb = context.session.store
|
|
76
|
-
|
|
77
|
-
const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
|
|
78
|
-
const ct = cts ? cts[0].split(';', 1)[0].trim() : null // remove content-type parameters
|
|
79
|
-
if (ct) {
|
|
80
|
-
// console.log('humanReadablePane: c-t:' + ct)
|
|
81
|
-
} else {
|
|
82
|
-
console.log('humanReadablePane: unknown content-type?')
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// @@ When we can, use CSP to turn off scripts within the iframe
|
|
86
|
-
div.setAttribute('class', 'docView')
|
|
87
|
-
const element = ct === 'text/markdown' ? 'DIV' : 'IFRAME'
|
|
88
|
-
const frame = myDocument.createElement(element)
|
|
89
|
-
|
|
90
|
-
const setIframeAttributes = (frame, blob, lines) => {
|
|
91
|
-
frame.setAttribute('src', URL.createObjectURL(blob));
|
|
92
|
-
frame.setAttribute('type', blob.type);
|
|
93
|
-
frame.setAttribute('class', 'doc');
|
|
94
|
-
frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`);
|
|
95
|
-
|
|
96
|
-
// Apply sandbox attribute only for HTML files
|
|
97
|
-
// @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
|
|
98
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
|
|
99
|
-
// You can't have any sandbox and allow plugins.
|
|
100
|
-
// We could sandbox only HTML files I suppose.
|
|
101
|
-
if (blob.type === 'text/html' || blob.type === 'application/xhtml+xml') {
|
|
102
|
-
frame.setAttribute('sandbox', 'allow-scripts allow-same-origin');
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// render markdown to html
|
|
107
|
-
const markdownHtml = function () {
|
|
108
|
-
kb.fetcher.webOperation('GET', subject.uri).then(response => {
|
|
109
|
-
const markdownText = response.responseText
|
|
110
|
-
const lines = Math.min(30, markdownText.split(/\n/).length + 5)
|
|
111
|
-
const res = marked.parse(markdownText)
|
|
112
|
-
const clean = DOMPurify.sanitize(res)
|
|
113
|
-
frame.innerHTML = clean
|
|
114
|
-
frame.setAttribute('class', 'doc')
|
|
115
|
-
frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`)
|
|
116
|
-
}).catch(error => {
|
|
117
|
-
console.error('Error fetching markdown content:', error)
|
|
118
|
-
frame.innerHTML = '<p>Error loading content</p>'
|
|
119
|
-
})
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (ct === 'text/markdown') {
|
|
123
|
-
markdownHtml()
|
|
124
|
-
} else {
|
|
125
|
-
// Fetch and process the blob
|
|
126
|
-
kb.fetcher._fetch(subject.uri)
|
|
127
|
-
.then(response => response.blob())
|
|
128
|
-
.then(blob => {
|
|
129
|
-
const blobTextPromise = blob.type.startsWith('text') ? blob.text() : Promise.resolve('')
|
|
130
|
-
return blobTextPromise.then(blobText => ({ blob, blobText }))
|
|
131
|
-
})
|
|
132
|
-
.then(({ blob, blobText }) => {
|
|
133
|
-
const newLines = blobText.includes('<script src="https://dokie.li/scripts/dokieli.js">') ? -10 : 5
|
|
134
|
-
const lines = Math.min(30, blobText.split(/\n/).length + newLines)
|
|
135
|
-
setIframeAttributes(frame, blob, lines)
|
|
136
|
-
})
|
|
137
|
-
.catch(err => {
|
|
138
|
-
console.log('Error fetching or processing blob:', err)
|
|
139
|
-
})
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const tr = myDocument.createElement('TR')
|
|
143
|
-
tr.appendChild(frame)
|
|
144
|
-
div.appendChild(tr)
|
|
145
|
-
return div
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export default humanReadablePane
|
|
150
|
-
// ends
|
package/src/imagePane.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/* Image Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane contains the document contents for an Image document
|
|
4
|
-
*/
|
|
5
|
-
import * as UI from 'solid-ui'
|
|
6
|
-
|
|
7
|
-
export const imagePane = {
|
|
8
|
-
icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',
|
|
9
|
-
|
|
10
|
-
name: 'image',
|
|
11
|
-
|
|
12
|
-
label: function (subject, context) {
|
|
13
|
-
const store = context.session.store
|
|
14
|
-
if (
|
|
15
|
-
!store.anyStatementMatching(
|
|
16
|
-
subject,
|
|
17
|
-
UI.ns.rdf('type'),
|
|
18
|
-
store.sym('http://purl.org/dc/terms/Image')
|
|
19
|
-
)
|
|
20
|
-
) {
|
|
21
|
-
// NB: Not dc: namespace!
|
|
22
|
-
return null
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// See also the source pane, which has lower precedence.
|
|
26
|
-
|
|
27
|
-
const contentTypeMatch = function (store, x, contentTypes) {
|
|
28
|
-
const cts = store.fetcher.getHeader(x, 'content-type')
|
|
29
|
-
if (cts) {
|
|
30
|
-
for (let j = 0; j < cts.length; j++) {
|
|
31
|
-
for (let k = 0; k < contentTypes.length; k++) {
|
|
32
|
-
if (cts[j].indexOf(contentTypes[k]) >= 0) {
|
|
33
|
-
return true
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return false
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const suppressed = ['application/pdf']
|
|
42
|
-
if (contentTypeMatch(store, subject, suppressed)) {
|
|
43
|
-
return null
|
|
44
|
-
}
|
|
45
|
-
return 'view'
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
render: function (subject, context) {
|
|
49
|
-
const myDocument = context.dom
|
|
50
|
-
const store = context.session.store
|
|
51
|
-
const div = myDocument.createElement('div')
|
|
52
|
-
div.setAttribute('class', 'imageView')
|
|
53
|
-
const img = myDocument.createElement('IMG')
|
|
54
|
-
|
|
55
|
-
// get image with authenticated fetch
|
|
56
|
-
store.fetcher._fetch(subject.uri)
|
|
57
|
-
.then(function(response) {
|
|
58
|
-
return response.blob()
|
|
59
|
-
})
|
|
60
|
-
.then(function(myBlob) {
|
|
61
|
-
const objectURL = URL.createObjectURL(myBlob)
|
|
62
|
-
img.setAttribute('src', objectURL) // w640 h480 //
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
img.setAttribute('style', 'max-width: 100%; max-height: 100%;')
|
|
66
|
-
// div.style['max-width'] = '640'
|
|
67
|
-
// div.style['max-height'] = '480'
|
|
68
|
-
const tr = myDocument.createElement('TR') // why need tr?
|
|
69
|
-
tr.appendChild(img)
|
|
70
|
-
div.appendChild(tr)
|
|
71
|
-
return div
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// ends
|
package/src/index.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* SOLID PANES
|
|
2
|
-
**
|
|
3
|
-
** Panes are regions of the outline view in which a particular subject is
|
|
4
|
-
** displayed in a particular way.
|
|
5
|
-
** Different panes about the same subject are typically stacked vertically.
|
|
6
|
-
** Panes may be used naked or with a pane selection header.
|
|
7
|
-
**
|
|
8
|
-
** The label() method has two functions: it determines whether the pane is
|
|
9
|
-
** relevant to a given subject, returning null if not.
|
|
10
|
-
** If it is relevant, then it returns a suitable tooltip for a control which selects the pane
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import versionInfo from './versionInfo'
|
|
14
|
-
import * as UI from 'solid-ui'
|
|
15
|
-
import { LiveStore } from 'rdflib'
|
|
16
|
-
import { solidLogicSingleton, store } from 'solid-logic'
|
|
17
|
-
import OutlineManager from './outline/manager.js'
|
|
18
|
-
import { registerPanes } from './registerPanes.js'
|
|
19
|
-
import {
|
|
20
|
-
list,
|
|
21
|
-
paneForIcon,
|
|
22
|
-
paneForPredicate,
|
|
23
|
-
register,
|
|
24
|
-
byName
|
|
25
|
-
} from 'pane-registry'
|
|
26
|
-
import { createContext } from './outline/context'
|
|
27
|
-
import initMainPage from './mainPage'
|
|
28
|
-
|
|
29
|
-
function getOutliner (dom) {
|
|
30
|
-
if (!dom.outlineManager) {
|
|
31
|
-
const context = createContext(
|
|
32
|
-
dom,
|
|
33
|
-
{ list, paneForIcon, paneForPredicate, register, byName },
|
|
34
|
-
store as LiveStore,
|
|
35
|
-
solidLogicSingleton
|
|
36
|
-
)
|
|
37
|
-
dom.outlineManager = new OutlineManager(context)
|
|
38
|
-
}
|
|
39
|
-
return dom.outlineManager
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (typeof window !== 'undefined') {
|
|
43
|
-
getOutliner(window.document)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
registerPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))
|
|
47
|
-
|
|
48
|
-
// This has common outline mode functionality for the default and other other panes
|
|
49
|
-
// A separate outline manager is required per DOM in cases like a browser extension
|
|
50
|
-
// where there are many occurrences of window and of window.document
|
|
51
|
-
// But each DOM should have just one outline manager.
|
|
52
|
-
|
|
53
|
-
export {
|
|
54
|
-
OutlineManager,
|
|
55
|
-
getOutliner,
|
|
56
|
-
UI,
|
|
57
|
-
versionInfo,
|
|
58
|
-
initMainPage,
|
|
59
|
-
list, // from paneRegistry
|
|
60
|
-
paneForIcon, // from paneRegistry
|
|
61
|
-
paneForPredicate, // from paneRegistry
|
|
62
|
-
register, // from paneRegistry
|
|
63
|
-
byName // from paneRegistry
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// export for simpler access by non-node scripts
|
|
67
|
-
if (typeof window !== 'undefined') {
|
|
68
|
-
;(<any>window).panes = {
|
|
69
|
-
getOutliner
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
/* Internal Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane contains the properties which are
|
|
4
|
-
** internal to the user's interaction with the web, and are not normally displayed
|
|
5
|
-
*/
|
|
6
|
-
/* global alert confirm */
|
|
7
|
-
|
|
8
|
-
import { icons, ns, widgets } from 'solid-ui'
|
|
9
|
-
import { BlankNode, IndexedFormula, literal, NamedNode, st, sym, Variable, Store } from 'rdflib'
|
|
10
|
-
import { PaneDefinition } from 'pane-registry'
|
|
11
|
-
|
|
12
|
-
const pane: PaneDefinition = {
|
|
13
|
-
icon: icons.originalIconBase + 'tango/22-emblem-system.png',
|
|
14
|
-
|
|
15
|
-
name: 'internal',
|
|
16
|
-
|
|
17
|
-
label: function () {
|
|
18
|
-
return 'under the hood' // There is often a URI even of no statements
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
render: function (subject, context) {
|
|
22
|
-
const dom = context.dom
|
|
23
|
-
const store = context.session.store as Store
|
|
24
|
-
const canonizedSubject = store.canon(subject) as BlankNode | NamedNode | Variable
|
|
25
|
-
const types = store.findTypeURIs(canonizedSubject)
|
|
26
|
-
|
|
27
|
-
function filter (pred: NamedNode) {
|
|
28
|
-
if (types['http://www.w3.org/2007/ont/link#ProtocolEvent']) return true // display everything for them
|
|
29
|
-
const view = context.session.paneRegistry.byName('internal')
|
|
30
|
-
return (
|
|
31
|
-
view &&
|
|
32
|
-
view.predicates &&
|
|
33
|
-
!!(typeof view.predicates[pred.uri] !== 'undefined')
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const div = dom.createElement('div')
|
|
38
|
-
div.setAttribute('class', 'internalPane')
|
|
39
|
-
div.setAttribute(
|
|
40
|
-
'style',
|
|
41
|
-
'background-color: #ddddff; padding: 0.5em; border-radius: 1em;'
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
function deleteRecursive (kb: IndexedFormula, folder: NamedNode) {
|
|
45
|
-
const fetcher = (kb as any).fetcher
|
|
46
|
-
if (!fetcher) {
|
|
47
|
-
console.error('No fetcher available')
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
return new Promise(function (resolve, reject) {
|
|
51
|
-
fetcher.load(folder).then(function () {
|
|
52
|
-
const promises = kb.each(folder, ns.ldp('contains')).map(file => {
|
|
53
|
-
if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {
|
|
54
|
-
return deleteRecursive(kb, file as NamedNode)
|
|
55
|
-
} else {
|
|
56
|
-
console.log('deleteRecursive leaf file: ' + file)
|
|
57
|
-
return fetcher.webOperation('DELETE', (file as NamedNode).uri)
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
Promise.all(promises).then(
|
|
61
|
-
() => {
|
|
62
|
-
console.log('deleteRecursive empty folder: ' + folder)
|
|
63
|
-
fetcher
|
|
64
|
-
.webOperation('DELETE', folder.uri)
|
|
65
|
-
.then(() => {
|
|
66
|
-
console.log('Deleted Ok: ' + folder)
|
|
67
|
-
resolve(undefined)
|
|
68
|
-
})
|
|
69
|
-
.catch((err: string) => {
|
|
70
|
-
const str = 'Unable to delete ' + folder + ': ' + err
|
|
71
|
-
console.log(str)
|
|
72
|
-
reject(new Error(str))
|
|
73
|
-
})
|
|
74
|
-
resolve(undefined)
|
|
75
|
-
},
|
|
76
|
-
err => {
|
|
77
|
-
alert(err)
|
|
78
|
-
reject(err)
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const isDocument = subject.uri && !subject.uri.includes('#')
|
|
86
|
-
if (isDocument) {
|
|
87
|
-
const controls = div.appendChild(dom.createElement('table'))
|
|
88
|
-
controls.style.width = '100%'
|
|
89
|
-
controls.style.margin = '1em'
|
|
90
|
-
const controlRow = controls.appendChild(dom.createElement('tr'))
|
|
91
|
-
|
|
92
|
-
const deleteCell = controlRow.appendChild(dom.createElement('td'))
|
|
93
|
-
const isFolder =
|
|
94
|
-
(subject.uri && subject.uri.endsWith('/')) ||
|
|
95
|
-
store.holds(subject, ns.rdf('type'), ns.ldp('Container'))
|
|
96
|
-
const noun = isFolder ? 'folder' : 'file'
|
|
97
|
-
if (!isProtectedUri(subject)) {
|
|
98
|
-
console.log(subject)
|
|
99
|
-
const deleteButton = widgets.deleteButtonWithCheck(
|
|
100
|
-
dom,
|
|
101
|
-
deleteCell,
|
|
102
|
-
noun,
|
|
103
|
-
function () {
|
|
104
|
-
if (
|
|
105
|
-
!confirm(
|
|
106
|
-
`Are you sure you want to delete ${subject}? This cannot be undone.`
|
|
107
|
-
)
|
|
108
|
-
) {
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
// @@ TODO Remove casing of store.fetcher
|
|
112
|
-
if (!store.fetcher) {
|
|
113
|
-
throw new Error('Store has no fetcher')
|
|
114
|
-
}
|
|
115
|
-
const promise = isFolder
|
|
116
|
-
? (deleteRecursive(store, subject) || Promise.resolve())
|
|
117
|
-
: store.fetcher.webOperation('DELETE', subject.uri) || Promise.resolve()
|
|
118
|
-
promise
|
|
119
|
-
.then(() => {
|
|
120
|
-
const str = 'Deleted: ' + subject
|
|
121
|
-
console.log(str)
|
|
122
|
-
})
|
|
123
|
-
.catch((err: any) => {
|
|
124
|
-
const str = 'Unable to delete ' + subject + ': ' + err
|
|
125
|
-
console.log(str)
|
|
126
|
-
alert(str)
|
|
127
|
-
})
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
deleteButton.style = 'height: 2em;'
|
|
131
|
-
deleteButton.class = '' // Remove hover hide
|
|
132
|
-
deleteCell.appendChild(deleteButton)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const refreshCell = controlRow.appendChild(dom.createElement('td'))
|
|
136
|
-
const refreshButton = widgets.button(
|
|
137
|
-
dom,
|
|
138
|
-
icons.iconBase + 'noun_479395.svg',
|
|
139
|
-
'refresh'
|
|
140
|
-
)
|
|
141
|
-
refreshCell.appendChild(refreshButton)
|
|
142
|
-
refreshButton.addEventListener('click', () => {
|
|
143
|
-
if (!store.fetcher) {
|
|
144
|
-
throw new Error('Store has no fetcher')
|
|
145
|
-
}
|
|
146
|
-
store.fetcher.refresh(subject, function (
|
|
147
|
-
ok,
|
|
148
|
-
errm
|
|
149
|
-
) {
|
|
150
|
-
let str
|
|
151
|
-
if (ok) {
|
|
152
|
-
str = 'Refreshed OK: ' + subject
|
|
153
|
-
} else {
|
|
154
|
-
str = 'Error refreshing: ' + subject + ': ' + errm
|
|
155
|
-
}
|
|
156
|
-
console.log(str)
|
|
157
|
-
alert(str)
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
let plist = store.statementsMatching(subject)
|
|
163
|
-
let docURI = ''
|
|
164
|
-
if (!store.fetcher) {
|
|
165
|
-
throw new Error('Store has no fetcher')
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (subject.uri) {
|
|
169
|
-
plist.push(
|
|
170
|
-
st(
|
|
171
|
-
subject,
|
|
172
|
-
sym('http://www.w3.org/2007/ont/link#uri'),
|
|
173
|
-
subject.uri as any, // @@ TODO Remove casting
|
|
174
|
-
store.fetcher.appNode
|
|
175
|
-
)
|
|
176
|
-
)
|
|
177
|
-
if (subject.uri.indexOf('#') >= 0) {
|
|
178
|
-
docURI = subject.uri.split('#')[0]
|
|
179
|
-
plist.push(
|
|
180
|
-
st(
|
|
181
|
-
subject,
|
|
182
|
-
sym('http://www.w3.org/2007/ont/link#documentURI'),
|
|
183
|
-
subject.uri.split('#')[0] as any, // @@ TODO Remove casting
|
|
184
|
-
store.fetcher.appNode
|
|
185
|
-
)
|
|
186
|
-
)
|
|
187
|
-
plist.push(
|
|
188
|
-
st(
|
|
189
|
-
subject,
|
|
190
|
-
sym('http://www.w3.org/2007/ont/link#document'),
|
|
191
|
-
sym(subject.uri.split('#')[0]),
|
|
192
|
-
store.fetcher.appNode
|
|
193
|
-
)
|
|
194
|
-
)
|
|
195
|
-
} else {
|
|
196
|
-
docURI = subject.uri
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (docURI) {
|
|
200
|
-
if (!store.updater) {
|
|
201
|
-
throw new Error('Store has no updater')
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
const ed = store.updater.editable(docURI)
|
|
205
|
-
if (ed) {
|
|
206
|
-
plist.push(
|
|
207
|
-
st(
|
|
208
|
-
subject,
|
|
209
|
-
sym('http://www.w3.org/ns/rww#editable'),
|
|
210
|
-
literal(ed.toString()),
|
|
211
|
-
store.fetcher.appNode
|
|
212
|
-
)
|
|
213
|
-
)
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
// @@ TODO get a proper type
|
|
217
|
-
const outliner: any = context.getOutliner(dom)
|
|
218
|
-
outliner.appendPropertyTRs(div, plist, false, filter)
|
|
219
|
-
plist = store.statementsMatching(undefined, undefined, subject)
|
|
220
|
-
outliner.appendPropertyTRs(div, plist, true, filter)
|
|
221
|
-
return div
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
predicates: {
|
|
225
|
-
// Predicates used for inner workings. Under the hood
|
|
226
|
-
'http://www.w3.org/2007/ont/link#request': 1,
|
|
227
|
-
'http://www.w3.org/2007/ont/link#requestedBy': 1,
|
|
228
|
-
'http://www.w3.org/2007/ont/link#source': 1,
|
|
229
|
-
'http://www.w3.org/2007/ont/link#session': 2, // 2= test neg but display
|
|
230
|
-
'http://www.w3.org/2007/ont/link#uri': 1,
|
|
231
|
-
'http://www.w3.org/2007/ont/link#documentURI': 1,
|
|
232
|
-
'http://www.w3.org/2007/ont/link#document': 1,
|
|
233
|
-
'http://www.w3.org/2007/ont/link#all': 1, // From userinput.js
|
|
234
|
-
'http://www.w3.org/2007/ont/link#Document': 1,
|
|
235
|
-
'http://www.w3.org/ns/rww#editable': 1,
|
|
236
|
-
'http://www.w3.org/2000/01/rdf-schema#seeAlso': 1,
|
|
237
|
-
'http://www.w3.org/2002/07/owl#': 1
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
classes: {
|
|
241
|
-
// Things which are inherently already undercover
|
|
242
|
-
'http://www.w3.org/2007/ont/link#ProtocolEvent': 1
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
function isProtectedUri (subject: NamedNode): boolean {
|
|
247
|
-
// TODO: Could make the code below smarter by removing some of the redundancy by creating a recursive function, but did not bother now
|
|
248
|
-
const siteUri = subject.site().uri
|
|
249
|
-
return (
|
|
250
|
-
subject.uri === siteUri ||
|
|
251
|
-
subject.uri === siteUri + 'profile/' ||
|
|
252
|
-
subject.uri === siteUri + 'profile/card' ||
|
|
253
|
-
subject.uri === siteUri + 'settings/' ||
|
|
254
|
-
subject.uri === siteUri + 'settings/prefs.ttl' ||
|
|
255
|
-
subject.uri === siteUri + 'settings/privateTypeIndex.ttl' ||
|
|
256
|
-
subject.uri === siteUri + 'settings/publicTypeIndex.ttl' ||
|
|
257
|
-
subject.uri === siteUri + 'settings/serverSide.ttl'
|
|
258
|
-
)
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export default pane
|
|
262
|
-
|
|
263
|
-
// ends
|
package/src/mainPage/footer.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { LiveStore } from 'rdflib'
|
|
2
|
-
import { initFooter } from 'solid-ui'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* links in the footer
|
|
6
|
-
*/
|
|
7
|
-
const SOLID_PROJECT_URL = 'https://solidproject.org'
|
|
8
|
-
const SOLID_PROJECT_NAME = 'solidproject.org'
|
|
9
|
-
|
|
10
|
-
export function createFooter (store: LiveStore) {
|
|
11
|
-
initFooter(store, setFooterOptions())
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function setFooterOptions () {
|
|
15
|
-
return {
|
|
16
|
-
solidProjectUrl: SOLID_PROJECT_URL,
|
|
17
|
-
solidProjectName: SOLID_PROJECT_NAME
|
|
18
|
-
}
|
|
19
|
-
}
|
package/src/mainPage/header.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { authSession, authn } from 'solid-logic'
|
|
2
|
-
import { icons, initHeader } from 'solid-ui'
|
|
3
|
-
/**
|
|
4
|
-
* menu icons
|
|
5
|
-
*/
|
|
6
|
-
const HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'
|
|
7
|
-
const SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* menu elements
|
|
11
|
-
*/
|
|
12
|
-
const USER_GUIDE_MENU_ITEM = 'User guide'
|
|
13
|
-
const REPORT_A_PROBLEM_MENU_ITEM = 'Report a problem'
|
|
14
|
-
const SHOW_YOUR_PROFILE_MENU_ITEM = 'Show your profile'
|
|
15
|
-
const LOG_OUT_MENU_ITEM = 'Log out'
|
|
16
|
-
|
|
17
|
-
type UserMenuItem = { label: string; onclick: () => void } ;
|
|
18
|
-
/**
|
|
19
|
-
* URLS
|
|
20
|
-
*/
|
|
21
|
-
const USER_GUIDE_MENU_URL = 'https://solidos.github.io/userguide/'
|
|
22
|
-
const REPORT_A_PROBLEM_MENU_URL = 'https://github.com/solidos/solidos/issues'
|
|
23
|
-
|
|
24
|
-
export async function createHeader (store, outliner) {
|
|
25
|
-
initHeader(store, await setUserMenu(outliner), setHeaderOptions())
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function setHeaderOptions () {
|
|
29
|
-
const helpMenuList = [
|
|
30
|
-
{ label: USER_GUIDE_MENU_ITEM, url: USER_GUIDE_MENU_URL, target: '_blank' },
|
|
31
|
-
{ label: REPORT_A_PROBLEM_MENU_ITEM, url: REPORT_A_PROBLEM_MENU_URL, target: '_blank' }
|
|
32
|
-
]
|
|
33
|
-
const headerOptions = { logo: SOLID_ICON_URL, helpIcon: HELP_MENU_ICON, helpMenuList: helpMenuList }
|
|
34
|
-
|
|
35
|
-
return headerOptions
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function setUserMenu (outliner: any) {
|
|
39
|
-
const showProfile = {
|
|
40
|
-
label: SHOW_YOUR_PROFILE_MENU_ITEM,
|
|
41
|
-
onclick: () => openUserProfile(outliner)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const logOut: UserMenuItem = {
|
|
45
|
-
label: LOG_OUT_MENU_ITEM,
|
|
46
|
-
onclick: () => {
|
|
47
|
-
authSession.logout()
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// the order of the menu is important here, show profile first and logout last
|
|
52
|
-
let userMenuList:UserMenuItem[] = [] // was [showProfile]
|
|
53
|
-
userMenuList = userMenuList.concat(await getMenuItems(outliner));
|
|
54
|
-
userMenuList.push(logOut)
|
|
55
|
-
|
|
56
|
-
return userMenuList
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Does not work to jump to user profile,
|
|
60
|
-
function openUserProfile (outliner: any) {
|
|
61
|
-
outliner.GotoSubject(authn.currentUser(), true, undefined, true, undefined)
|
|
62
|
-
location.reload()
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async function getMenuItems (outliner: any) {
|
|
66
|
-
const items = await outliner.getDashboardItems()
|
|
67
|
-
return items.map((element) => {
|
|
68
|
-
return {
|
|
69
|
-
label: element.label,
|
|
70
|
-
onclick: () => openDashboardPane(outliner, element.tabName || element.paneName)
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function openDashboardPane (outliner: any, pane: string): Promise<void> {
|
|
76
|
-
outliner.showDashboard({
|
|
77
|
-
pane
|
|
78
|
-
})
|
|
79
|
-
}
|
package/src/mainPage/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* Main Page
|
|
2
|
-
**
|
|
3
|
-
** This code is called in mashlib and renders the header and footer of the Databrowser.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { LiveStore, NamedNode } from 'rdflib'
|
|
7
|
-
import { getOutliner } from '../index'
|
|
8
|
-
import { createHeader } from './header'
|
|
9
|
-
import { createFooter } from './footer'
|
|
10
|
-
|
|
11
|
-
export default async function initMainPage (store: LiveStore, uri?: string|NamedNode|null) {
|
|
12
|
-
const outliner = getOutliner(document)
|
|
13
|
-
uri = uri || window.location.href
|
|
14
|
-
let subject = uri
|
|
15
|
-
if (typeof uri === 'string') subject = store.sym(uri)
|
|
16
|
-
outliner.GotoSubject(subject, true, undefined, true, undefined)
|
|
17
|
-
const header = await createHeader(store, outliner)
|
|
18
|
-
const footer = createFooter(store)
|
|
19
|
-
return Promise.all([header, footer])
|
|
20
|
-
}
|
package/src/meeting/Makefile
DELETED