solid-panes 4.2.6 → 4.4.1-test.0
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/README.md +45 -1
- package/dist/0314353e28ce6e5539af.svg +9 -0
- package/dist/04567ff683933c35c465.png +0 -0
- package/dist/10163fd9b5a0e00d63a0.png +0 -0
- package/dist/1234dcb2eec2e45f252b.png +0 -0
- package/dist/20899934157df4db56cb.png +0 -0
- package/dist/33760bf79f097f449da5.png +0 -0
- package/dist/4cceba29ab33b1ddd9bb.svg +6 -0
- package/dist/578d2b6ed32e7624164e.png +0 -0
- package/dist/5f62a5b2b7e99b9640c7.png +0 -0
- package/dist/6525766ecd288ec60129.png +0 -0
- package/dist/7800be6f6c4b5b0f4f20.png +0 -0
- package/dist/7b7538c6f6b317968009.svg +9 -0
- package/dist/92d03142abe6efc0b42d.svg +6 -0
- package/dist/976473cf5fe24d657d4b.png +0 -0
- package/dist/RDFXMLPane.css +70 -0
- package/dist/RDFXMLPane.d.ts +13 -0
- package/dist/RDFXMLPane.d.ts.map +1 -0
- package/dist/RDFXMLPane.js +46 -4
- package/dist/bda84f59e7216675a208.png +0 -0
- package/dist/cd68e8f3990ba8b2139e.png +0 -0
- package/dist/dashboard/basicPreferences.d.ts.map +1 -1
- package/dist/dashboard/basicPreferences.js +1 -0
- package/dist/dashboard/dashboardPane.d.ts.map +1 -1
- package/dist/dashboard/dashboardPane.js +9 -3
- package/dist/dashboard/homepage.d.ts +1 -1
- package/dist/dashboard/homepage.d.ts.map +1 -1
- package/dist/dashboard/homepage.js +5 -35
- package/dist/dataContentPane.css +271 -0
- package/dist/dataContentPane.d.ts +14 -0
- package/dist/dataContentPane.d.ts.map +1 -0
- package/dist/dataContentPane.js +68 -101
- package/dist/defaultPane.css +97 -0
- package/dist/defaultPane.d.ts +14 -0
- package/dist/defaultPane.d.ts.map +1 -0
- package/dist/defaultPane.js +9 -2
- package/dist/e7074a7e2cb69e51cfd3.png +0 -0
- package/dist/f3772696fb7ee53c23d8.png +0 -0
- package/dist/form/formPane.css +120 -0
- package/dist/form/pane.d.ts +4 -0
- package/dist/form/pane.d.ts.map +1 -0
- package/dist/form/pane.js +120 -54
- package/dist/home/homePane.d.ts.map +1 -1
- package/dist/home/homePane.js +2 -0
- package/dist/humanReadablePane.css +129 -0
- package/dist/humanReadablePane.d.ts +13 -0
- package/dist/humanReadablePane.d.ts.map +1 -0
- package/dist/humanReadablePane.js +53 -16
- package/dist/icons/clock.svg +7 -0
- package/dist/icons/comment.svg +6 -0
- package/dist/icons/dashboard.svg +9 -0
- package/dist/icons/downArrow.svg +6 -0
- package/dist/icons/folder.svg +6 -0
- package/dist/icons/friends.svg +9 -0
- package/dist/icons/help.svg +8 -0
- package/dist/icons/iconHelper.d.ts +2 -0
- package/dist/icons/iconHelper.d.ts.map +1 -0
- package/dist/icons/iconHelper.js +23 -0
- package/dist/icons/menu.svg +8 -0
- package/dist/icons/person.svg +6 -0
- package/dist/icons/personInCircle.svg +8 -0
- package/dist/icons/sharing.svg +10 -0
- package/dist/icons/signOut.svg +8 -0
- package/dist/icons/signUp.svg +9 -0
- package/dist/icons/star.svg +3 -0
- package/dist/imagePane.css +4 -0
- package/dist/imagePane.d.ts +12 -0
- package/dist/imagePane.d.ts.map +1 -0
- package/dist/imagePane.js +19 -21
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -4
- package/dist/internal/internalPane.css +14 -0
- package/dist/internal/internalPane.d.ts +1 -0
- package/dist/internal/internalPane.d.ts.map +1 -1
- package/dist/internal/internalPane.js +6 -6
- package/dist/mainPage/footer.d.ts +14 -2
- package/dist/mainPage/footer.d.ts.map +1 -1
- package/dist/mainPage/footer.js +21 -13
- package/dist/mainPage/header.d.ts +16 -1
- package/dist/mainPage/header.d.ts.map +1 -1
- package/dist/mainPage/header.js +179 -61
- package/dist/mainPage/index.d.ts +16 -1
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.js +61 -7
- package/dist/mainPage/menu.css +243 -0
- package/dist/mainPage/menu.d.ts +7 -0
- package/dist/mainPage/menu.d.ts.map +1 -0
- package/dist/mainPage/menu.js +436 -0
- package/dist/n3Pane.css +49 -0
- package/dist/n3Pane.d.ts +13 -0
- package/dist/n3Pane.d.ts.map +1 -0
- package/dist/n3Pane.js +36 -4
- package/dist/outline/context.d.ts +2 -2
- package/dist/outline/context.d.ts.map +1 -1
- package/dist/outline/context.js +5 -2
- package/dist/outline/manager.css +12 -14
- package/dist/outline/manager.js +172 -82
- package/dist/outline/userInput.js +6 -3
- package/dist/pad/padPane.css +40 -0
- package/dist/pad/padPane.d.ts +1 -0
- package/dist/pad/padPane.d.ts.map +1 -1
- package/dist/pad/padPane.js +33 -22
- package/dist/playlist/playlistPane.js +2 -6
- package/dist/profileUtils/ownerProfile.d.ts +5 -0
- package/dist/profileUtils/ownerProfile.d.ts.map +1 -0
- package/dist/profileUtils/ownerProfile.js +84 -0
- package/dist/registerPanes.js +12 -12
- package/dist/schedule/schedulePane.css +294 -0
- package/dist/schedule/schedulePane.d.ts +23 -0
- package/dist/schedule/schedulePane.d.ts.map +1 -0
- package/dist/schedule/schedulePane.js +161 -61
- package/dist/slideshow/slideshowPane.js +1 -1
- package/dist/social/editProfileDetails.d.ts +19 -0
- package/dist/social/editProfileDetails.d.ts.map +1 -0
- package/dist/social/editProfileDetails.js +362 -0
- package/dist/social/icons.d.ts +7 -0
- package/dist/social/icons.d.ts.map +1 -0
- package/dist/social/icons.js +95 -0
- package/dist/social/socialPane.css +1464 -0
- package/dist/social/socialPane.d.ts +30 -0
- package/dist/social/socialPane.d.ts.map +1 -0
- package/dist/social/socialPane.js +651 -0
- package/dist/social/socialSections.d.ts +77 -0
- package/dist/social/socialSections.d.ts.map +1 -0
- package/dist/social/socialSections.js +393 -0
- package/dist/social/spinner.d.ts +3 -0
- package/dist/social/spinner.d.ts.map +1 -0
- package/dist/social/spinner.js +13 -0
- package/dist/social/triage.d.ts +17 -0
- package/dist/social/triage.d.ts.map +1 -0
- package/dist/social/triage.js +79 -0
- package/dist/solid-panes.js +49544 -18164
- package/dist/solid-panes.js.map +1 -1
- package/dist/solid-panes.min.js +3884 -240
- package/dist/solid-panes.min.js.map +1 -1
- package/dist/{style → styles}/tabbedtab.css +0 -281
- package/dist/styles/utilities.css +5 -0
- package/dist/tabbed/tabbedPane.d.ts.map +1 -1
- package/dist/tabbed/tabbedPane.js +2 -0
- package/dist/versionInfo.js +14 -14
- package/package.json +37 -31
- package/dist/socialPane.js +0 -430
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultPane.d.ts","sourceRoot":"","sources":["../src/defaultPane.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AACtE,OAAO,mBAAmB,CAAA;AAG1B,KAAK,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;AAEzD,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,MAAM,CAAA;IAC9C,MAAM,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CACrF,CAAA;AAcD,eAAO,MAAM,WAAW,EAAE,qBAqGzB,CAAA"}
|
package/dist/defaultPane.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.defaultPane = void 0;
|
|
7
7
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
8
8
|
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
9
|
+
require("./defaultPane.css");
|
|
9
10
|
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); }
|
|
10
11
|
/* Default Pane
|
|
11
12
|
**
|
|
@@ -24,6 +25,10 @@ const defaultPane = exports.defaultPane = {
|
|
|
24
25
|
},
|
|
25
26
|
render: function (subject, context) {
|
|
26
27
|
const dom = context.dom;
|
|
28
|
+
function applyEnvironmentAttributes(element) {
|
|
29
|
+
const environment = context.environment ?? {};
|
|
30
|
+
element.dataset.layout = environment.layout ?? 'desktop';
|
|
31
|
+
}
|
|
27
32
|
const filter = function (pred, inverse) {
|
|
28
33
|
if (typeof context.session.paneRegistry.byName('internal').predicates[pred.uri] !== 'undefined') {
|
|
29
34
|
return false;
|
|
@@ -40,16 +45,18 @@ const defaultPane = exports.defaultPane = {
|
|
|
40
45
|
subject = kb.canon(subject);
|
|
41
46
|
const div = dom.createElement('div');
|
|
42
47
|
div.setAttribute('class', 'defaultPane');
|
|
48
|
+
applyEnvironmentAttributes(div);
|
|
43
49
|
// appendRemoveIcon(div, subject, div)
|
|
44
50
|
|
|
45
|
-
let plist = kb.statementsMatching(subject);
|
|
51
|
+
let plist = subject.termType === 'Literal' ? [] : kb.statementsMatching(subject);
|
|
46
52
|
outliner.appendPropertyTRs(div, plist, false, filter);
|
|
47
53
|
plist = kb.statementsMatching(undefined, undefined, subject);
|
|
48
54
|
outliner.appendPropertyTRs(div, plist, true, filter);
|
|
55
|
+
const subjectStatement = subject.termType === 'BlankNode' ? kb.anyStatementMatching(subject) : undefined;
|
|
49
56
|
if (subject.termType === 'Literal' && subject.value.slice(0, 7) === 'http://') {
|
|
50
57
|
outliner.appendPropertyTRs(div, [$rdf.st(kb.sym(subject.value), UI.ns.link('uri'), subject)], true, filter);
|
|
51
58
|
}
|
|
52
|
-
if (subject.termType === 'NamedNode' && kb.updater.editable($rdf.Util.uri.docpart(subject.uri), kb) || subject.termType === 'BlankNode' &&
|
|
59
|
+
if (subject.termType === 'NamedNode' && kb.updater.editable($rdf.Util.uri.docpart(subject.uri), kb) || subject.termType === 'BlankNode' && subjectStatement && subjectStatement.why && 'uri' in subjectStatement.why && typeof subjectStatement.why.uri === 'string' && kb.updater.editable(subjectStatement.why.uri)
|
|
53
60
|
// check the document containing something about of the bnode @@ what about as object?
|
|
54
61
|
/* ! && HCIoptions["bottom insert highlights"].enabled */) {
|
|
55
62
|
const holdingTr = dom.createElement('tr'); // these are to minimize required changes
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.formPane a {
|
|
2
|
+
color: var(--color-text-link, #3b5998);
|
|
3
|
+
text-decoration: none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.formPane a:link {
|
|
7
|
+
color: var(--color-text-link, #3b5998);
|
|
8
|
+
text-decoration: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.formPane a:visited {
|
|
12
|
+
color: var(--color-text-link-visited, #3b5998);
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.formPane a:hover {
|
|
17
|
+
color: var(--color-text-link-hover, #3b5998);
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.formPane a:active {
|
|
22
|
+
color: var(--color-text-link-active, #888);
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.formPane__message,
|
|
27
|
+
.formPaneMessage {
|
|
28
|
+
color: #666;
|
|
29
|
+
margin: var(--spacing-xs, 0.5em) 0;
|
|
30
|
+
padding: var(--spacing-xs, 0.35em) var(--spacing-xs, 0.5em);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.formPane__message--info {
|
|
34
|
+
background-color: var(--color-main-block-bg, #eee);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.formPane__message--error {
|
|
38
|
+
background-color: var(--color-log-error-bg, #fee);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.formPane__editButton {
|
|
42
|
+
margin-left: auto;
|
|
43
|
+
align-self: center;
|
|
44
|
+
padding: var(--spacing-xs, 0.5rem);
|
|
45
|
+
border: .5rem solid white;
|
|
46
|
+
font-size: 100%;
|
|
47
|
+
float: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.formPane .formPane__mobileTextareaValue > div {
|
|
51
|
+
display: block;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
position: relative;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.formPane .formPane__mobileTextareaValue > div > textarea {
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.formPane .formPane__mobileTextareaValue > div > button[type='button'] {
|
|
64
|
+
float: none !important;
|
|
65
|
+
position: absolute;
|
|
66
|
+
right: 0;
|
|
67
|
+
top: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.formPane[data-layout='mobile'] .formPane__mobileTextareaRow {
|
|
71
|
+
flex-direction: column !important;
|
|
72
|
+
align-items: stretch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.formPane[data-layout='mobile'] .formPane__mobileTextareaLabel {
|
|
76
|
+
width: auto !important;
|
|
77
|
+
padding-bottom: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.formPane[data-layout='mobile'] .formPane__mobileTextareaValue {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
padding-right: var(--spacing-sm, 0.75rem);
|
|
84
|
+
width: 100%;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.formPane[data-layout='mobile'] .formPane__mobileTextareaValue textarea {
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
margin-left: 0 !important;
|
|
90
|
+
margin-right: 0 !important;
|
|
91
|
+
max-width: 100%;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (max-width: 960px) {
|
|
96
|
+
.formPane .formPane__mobileTextareaRow {
|
|
97
|
+
flex-direction: column !important;
|
|
98
|
+
align-items: stretch;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.formPane .formPane__mobileTextareaLabel {
|
|
102
|
+
width: auto !important;
|
|
103
|
+
padding-bottom: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.formPane .formPane__mobileTextareaValue {
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
min-width: 0;
|
|
109
|
+
padding-right: var(--spacing-sm, 0.75rem);
|
|
110
|
+
width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.formPane .formPane__mobileTextareaValue textarea {
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
margin-left: 0 !important;
|
|
116
|
+
margin-right: 0 !important;
|
|
117
|
+
max-width: 100%;
|
|
118
|
+
width: 100%;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pane.d.ts","sourceRoot":"","sources":["../../src/form/pane.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,eAAe,CAAA;AAGvE,OAAO,gBAAgB,CAAA;AAsEvB,eAAO,MAAM,QAAQ,EAAE,cAqOtB,CAAA"}
|
package/dist/form/pane.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.formPane = 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("./formPane.css");
|
|
10
11
|
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
12
|
/*
|
|
12
13
|
** Pane for running existing forms for any object
|
|
@@ -14,12 +15,63 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
const ns = UI.ns;
|
|
18
|
+
function isNamedNode(term) {
|
|
19
|
+
return term?.termType === 'NamedNode';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* The following helper was generated by AI GPT-5.4 Model */
|
|
23
|
+
/* Prompt: Add a compatibility shim in the form pane for mixed `ui:Group` plus field typing. */
|
|
24
|
+
function normalizeAmbiguousFieldTypes(store, form) {
|
|
25
|
+
const formDoc = form.doc ? form.doc() : undefined;
|
|
26
|
+
const types = store.each(form, ns.rdf('type'), undefined, formDoc).filter(isNamedNode);
|
|
27
|
+
const hasGroupType = types.some(type => type.sameTerm(ns.ui('Group')));
|
|
28
|
+
const hasOtherFieldType = types.some(type => !type.sameTerm(ns.ui('Group')) && !type.sameTerm(ns.ui('Form')));
|
|
29
|
+
const hasProperty = !!store.any(form, ns.ui('property'), undefined, formDoc);
|
|
30
|
+
const partsList = store.any(form, ns.ui('parts'), undefined, formDoc);
|
|
31
|
+
const hasParts = !!partsList?.elements?.length || store.each(form, ns.ui('part'), undefined, formDoc).length > 0;
|
|
32
|
+
|
|
33
|
+
// Some legacy forms mark a leaf field as both ui:Group and a concrete input type.
|
|
34
|
+
// solid-ui may then choose the Group renderer and produce an empty nested box.
|
|
35
|
+
if (hasGroupType && hasOtherFieldType && hasProperty && !hasParts) {
|
|
36
|
+
store.removeMany(form, ns.rdf('type'), ns.ui('Group'), formDoc);
|
|
37
|
+
}
|
|
38
|
+
const listParts = partsList?.elements ?? [];
|
|
39
|
+
for (const part of listParts) {
|
|
40
|
+
if (isNamedNode(part)) {
|
|
41
|
+
normalizeAmbiguousFieldTypes(store, part);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const unorderedParts = store.each(form, ns.ui('part'), undefined, formDoc);
|
|
45
|
+
for (const part of unorderedParts) {
|
|
46
|
+
if (isNamedNode(part)) {
|
|
47
|
+
normalizeAmbiguousFieldTypes(store, part);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function tagMobileTextareaRows(renderedForm) {
|
|
52
|
+
const textareas = Array.from(renderedForm.querySelectorAll('textarea'));
|
|
53
|
+
for (const textarea of textareas) {
|
|
54
|
+
let row = textarea.parentElement;
|
|
55
|
+
while (row) {
|
|
56
|
+
const firstChild = row.firstElementChild;
|
|
57
|
+
const hasLabelColumn = !!firstChild && (firstChild.classList.contains('formFieldName') || firstChild.querySelector('a') !== null);
|
|
58
|
+
if (hasLabelColumn && row.children.length >= 2) {
|
|
59
|
+
row.classList.add('formPane__mobileTextareaRow');
|
|
60
|
+
firstChild.classList.add('formPane__mobileTextareaLabel');
|
|
61
|
+
const valueColumn = row.children[1];
|
|
62
|
+
valueColumn.classList.add('formPane__mobileTextareaValue');
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
row = row.parentElement;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
17
69
|
const formPane = exports.formPane = {
|
|
18
70
|
icon: UI.icons.iconBase + 'noun_122196.svg',
|
|
19
71
|
name: 'form',
|
|
20
72
|
audience: [ns.solid('PowerUser')],
|
|
21
73
|
// Does the subject deserve this pane?
|
|
22
|
-
label: function (subject) {
|
|
74
|
+
label: function (subject, _context) {
|
|
23
75
|
const n = UI.widgets.formsFor(subject).length;
|
|
24
76
|
UI.log.debug('Form pane: forms for ' + subject + ': ' + n);
|
|
25
77
|
if (!n) return null;
|
|
@@ -28,14 +80,21 @@ const formPane = exports.formPane = {
|
|
|
28
80
|
render: function (subject, context) {
|
|
29
81
|
const kb = context.session.store;
|
|
30
82
|
const dom = context.dom;
|
|
31
|
-
const
|
|
83
|
+
const box = dom.createElement('div');
|
|
84
|
+
box.setAttribute('class', 'formPane');
|
|
85
|
+
function applyEnvironmentAttributes(element) {
|
|
86
|
+
const environment = context.environment ?? {};
|
|
87
|
+
element.dataset.layout = environment.layout ?? 'desktop';
|
|
88
|
+
}
|
|
89
|
+
applyEnvironmentAttributes(box);
|
|
90
|
+
const mention = function (message, modifier = 'info') {
|
|
32
91
|
const pre = dom.createElement('p');
|
|
33
|
-
pre.
|
|
92
|
+
pre.className = `formPane__message formPane__message--${modifier}`;
|
|
34
93
|
box.appendChild(pre).textContent = message;
|
|
35
94
|
return pre;
|
|
36
95
|
};
|
|
37
|
-
const complain = function
|
|
38
|
-
mention(message, '
|
|
96
|
+
const complain = function (message) {
|
|
97
|
+
return mention(message, 'error');
|
|
39
98
|
};
|
|
40
99
|
const complainIfBad = function (ok, body) {
|
|
41
100
|
if (ok) {
|
|
@@ -51,8 +110,6 @@ const formPane = exports.formPane = {
|
|
|
51
110
|
// const t = kb.findTypeURIs(subject)
|
|
52
111
|
|
|
53
112
|
const me = _solidLogic.authn.currentUser();
|
|
54
|
-
const box = dom.createElement('div');
|
|
55
|
-
box.setAttribute('class', 'formPane');
|
|
56
113
|
if (!me) {
|
|
57
114
|
mention('You are not logged in. If you log in and have ' + 'workspaces then you would be able to select workspace in which ' + 'to put this new information');
|
|
58
115
|
} else {
|
|
@@ -66,30 +123,33 @@ const formPane = exports.formPane = {
|
|
|
66
123
|
|
|
67
124
|
// Render forms using a given store
|
|
68
125
|
|
|
69
|
-
const renderFormsFor = function (
|
|
70
|
-
kb.fetcher.nowOrWhenFetched(
|
|
71
|
-
if (!ok) return complain('Cannot load store ' +
|
|
126
|
+
const renderFormsFor = function (storeNode, targetSubject) {
|
|
127
|
+
kb.fetcher.nowOrWhenFetched(storeNode.uri, targetSubject, function (ok, body) {
|
|
128
|
+
if (!ok) return complain('Cannot load store ' + storeNode.uri + ': ' + body);
|
|
72
129
|
|
|
73
130
|
// Render the forms
|
|
74
131
|
|
|
75
|
-
const forms = UI.widgets.formsFor(
|
|
132
|
+
const forms = UI.widgets.formsFor(targetSubject);
|
|
76
133
|
|
|
77
134
|
// complain('Form for editing this form:');
|
|
78
|
-
for (
|
|
79
|
-
|
|
135
|
+
for (const form of forms) {
|
|
136
|
+
normalizeAmbiguousFieldTypes(kb, form);
|
|
80
137
|
const heading = dom.createElement('h4');
|
|
138
|
+
heading.classList.add('formPane__heading');
|
|
81
139
|
box.appendChild(heading);
|
|
140
|
+
/* The edit Form is not working in the local environment. it does not find
|
|
141
|
+
the ui FormForm ontology. Need to research further and check in production. */
|
|
82
142
|
if (form.uri) {
|
|
83
143
|
const formStore = $rdf.Util.uri.document(form.uri);
|
|
84
144
|
if (formStore.uri !== form.uri) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
e.setAttribute('style', 'float: right;');
|
|
145
|
+
const editButton = box.appendChild(UI.widgets.editFormButton(dom, box, form, formStore, complainIfBad));
|
|
146
|
+
editButton.classList.add('formPane__editButton');
|
|
88
147
|
}
|
|
89
148
|
}
|
|
90
149
|
const anchor = dom.createElement('a');
|
|
150
|
+
anchor.classList.add('formPane__headingLink');
|
|
91
151
|
anchor.setAttribute('href', form.uri);
|
|
92
|
-
heading.
|
|
152
|
+
heading.insertBefore(anchor, heading.firstChild);
|
|
93
153
|
anchor.textContent = UI.utils.label(form, true);
|
|
94
154
|
|
|
95
155
|
/* Keep tis as a reminder to let a New one have its URI given by user
|
|
@@ -103,7 +163,8 @@ const formPane = exports.formPane = {
|
|
|
103
163
|
ele.value = store.uri
|
|
104
164
|
*/
|
|
105
165
|
|
|
106
|
-
UI.widgets.appendForm(dom, box, {},
|
|
166
|
+
UI.widgets.appendForm(dom, box, {}, targetSubject, form, storeNode, complainIfBad);
|
|
167
|
+
tagMobileTextareaRows(box);
|
|
107
168
|
}
|
|
108
169
|
}); // end: when store loded
|
|
109
170
|
}; // renderFormsFor
|
|
@@ -112,64 +173,69 @@ const formPane = exports.formPane = {
|
|
|
112
173
|
|
|
113
174
|
// Which places are editable and have stuff about the subject?
|
|
114
175
|
|
|
115
|
-
let
|
|
176
|
+
let targetStore = null;
|
|
116
177
|
|
|
117
178
|
// 1. The document URI of the subject itself
|
|
118
179
|
const docuri = $rdf.Util.uri.docpart(subject.uri);
|
|
119
|
-
if (
|
|
120
|
-
|
|
180
|
+
if (kb.updater.editable(docuri, kb)) {
|
|
181
|
+
targetStore = subject.doc();
|
|
121
182
|
} // an editable data file with hash
|
|
122
183
|
|
|
123
|
-
|
|
184
|
+
const annotationStore = kb.any(kb.sym(docuri), ns.link('annotationStore'));
|
|
185
|
+
if (!targetStore && isNamedNode(annotationStore)) {
|
|
186
|
+
targetStore = annotationStore;
|
|
187
|
+
}
|
|
124
188
|
|
|
125
189
|
// 2. where stuff is already stored
|
|
126
|
-
if (!
|
|
127
|
-
const docs =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
190
|
+
if (!targetStore) {
|
|
191
|
+
const docs = new Map();
|
|
192
|
+
kb.statementsMatching(subject).forEach(function (st) {
|
|
193
|
+
if (st.why.value) {
|
|
194
|
+
docs.set(st.why.value, 1);
|
|
195
|
+
}
|
|
131
196
|
});
|
|
132
|
-
|
|
133
|
-
|
|
197
|
+
kb.statementsMatching(undefined, undefined, subject).forEach(function (st) {
|
|
198
|
+
if (st.why.value) {
|
|
199
|
+
docs.set(st.why.value, 2);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
const docList = Array.from(docs.entries()).sort(function ([uriA, scoreA], [uriB, scoreB]) {
|
|
203
|
+
return scoreA - scoreB || uriA.localeCompare(uriB);
|
|
134
204
|
});
|
|
135
|
-
for (const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const uri = docList[i][1];
|
|
139
|
-
if (uri && store.updater.editable(uri)) {
|
|
140
|
-
store = store.sym(uri);
|
|
205
|
+
for (const [uri] of docList) {
|
|
206
|
+
if (uri && kb.updater.editable(uri, kb)) {
|
|
207
|
+
targetStore = kb.sym(uri);
|
|
141
208
|
break;
|
|
142
209
|
}
|
|
143
210
|
}
|
|
144
211
|
}
|
|
145
212
|
|
|
146
213
|
// 3. In a workspace store
|
|
147
|
-
// @@ TODO: Can probably remove _followeach (not done this time because the commit is a very safe refactor)
|
|
148
|
-
const _followeach = function (kb, subject, path) {
|
|
149
|
-
if (path.length === 0) return [subject];
|
|
150
|
-
const oo = kb.each(subject, path[0]);
|
|
151
|
-
let res = [];
|
|
152
|
-
for (let i = 0; i < oo.length; i++) {
|
|
153
|
-
res = res.concat(_followeach(kb, oo[i], path.slice(1)));
|
|
154
|
-
}
|
|
155
|
-
return res;
|
|
156
|
-
};
|
|
157
214
|
const date = '2014'; // @@@@@@@@@@@@ pass as parameter
|
|
158
215
|
|
|
159
|
-
if (
|
|
216
|
+
if (targetStore) {
|
|
160
217
|
// mention("@@ Ok, we have a store <" + store.uri + ">.");
|
|
161
|
-
renderFormsFor(
|
|
218
|
+
renderFormsFor(targetStore, subject);
|
|
162
219
|
} else {
|
|
163
220
|
complain('No suitable store is known, to edit <' + subject.uri + '>.');
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
221
|
+
const workspaceDetails = {
|
|
222
|
+
noun: 'form',
|
|
223
|
+
appPathSegment: 'form'
|
|
224
|
+
};
|
|
225
|
+
const foobarbaz = UI.login.selectWorkspace(dom, workspaceDetails, function (workspaceUri) {
|
|
226
|
+
const workspace = workspaceUri ? kb.sym(workspaceUri) : null;
|
|
227
|
+
if (!workspace) {
|
|
228
|
+
complain('Workspace selection was cancelled.');
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
mention('Workspace selected OK: ' + workspace.uri);
|
|
232
|
+
const activities = kb.each(undefined, ns.space('workspace'), workspace).filter(isNamedNode);
|
|
167
233
|
for (let j = 0; j < activities.length; j++) {
|
|
168
234
|
const act = activities[j];
|
|
169
|
-
const subjectDoc2 =
|
|
170
|
-
const start =
|
|
171
|
-
const end =
|
|
172
|
-
if (subjectDoc2 && start && end && start <= date && end > date) {
|
|
235
|
+
const subjectDoc2 = kb.any(act, ns.space('store'));
|
|
236
|
+
const start = kb.any(act, ns.cal('dtstart'))?.value;
|
|
237
|
+
const end = kb.any(act, ns.cal('dtend'))?.value;
|
|
238
|
+
if (isNamedNode(subjectDoc2) && start && end && start <= date && end > date) {
|
|
173
239
|
renderFormsFor(subjectDoc2, subject);
|
|
174
240
|
break;
|
|
175
241
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homePane.d.ts","sourceRoot":"","sources":["../../src/home/homePane.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"homePane.d.ts","sourceRoot":"","sources":["../../src/home/homePane.ts"],"names":[],"mappings":"AAUA,OAAO,EAAsB,cAAc,EAAE,MAAM,eAAe,CAAA;AAMlE,QAAA,MAAM,cAAc,EAAE,cAuDrB,CAAA;AAGD,eAAe,cAAc,CAAA"}
|
package/dist/home/homePane.js
CHANGED
|
@@ -29,6 +29,7 @@ const HomePaneSource = {
|
|
|
29
29
|
label: function () {
|
|
30
30
|
return 'home';
|
|
31
31
|
},
|
|
32
|
+
audience: [_solidUi.ns.solid('PowerUser')],
|
|
32
33
|
render: function (subject, context) {
|
|
33
34
|
const dom = context.dom;
|
|
34
35
|
const showContent = async function () {
|
|
@@ -56,6 +57,7 @@ const HomePaneSource = {
|
|
|
56
57
|
me
|
|
57
58
|
};
|
|
58
59
|
const relevantPanes = await _solidUi.login.filterAvailablePanes(context.session.paneRegistry.list);
|
|
60
|
+
// @ts-ignore
|
|
59
61
|
_solidUi.create.newThingUI(creationContext, context, relevantPanes); // newUI Have to pass panes down
|
|
60
62
|
|
|
61
63
|
_solidUi.login.registrationList(homePaneContext, {}).then(function () {});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
.human-readable-pane {
|
|
2
|
+
display: block;
|
|
3
|
+
min-width: 0;
|
|
4
|
+
width: 100%;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.human-readable-pane__container {
|
|
10
|
+
display: block;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
overflow-x: hidden;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.human-readable-pane__frame {
|
|
19
|
+
display: block;
|
|
20
|
+
border: 1px solid;
|
|
21
|
+
padding: 1rem;
|
|
22
|
+
height: var(--human-readable-pane-height, 30rem);
|
|
23
|
+
min-width: 0;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
width: 100%;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
resize: both;
|
|
28
|
+
overflow: auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.human-readable-pane__frame--iframe {
|
|
32
|
+
padding: 0;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
width: 100%;
|
|
35
|
+
max-width: 100%;
|
|
36
|
+
min-height: 18rem;
|
|
37
|
+
background: var(--color-background, white);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.human-readable-pane__frame--markdown {
|
|
41
|
+
overflow-wrap: anywhere;
|
|
42
|
+
word-break: break-word;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.human-readable-pane__frame--plain-text {
|
|
46
|
+
font-family: monospace;
|
|
47
|
+
white-space: pre-wrap;
|
|
48
|
+
overflow-wrap: anywhere;
|
|
49
|
+
word-break: break-word;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.human-readable-pane__frame--markdown > * {
|
|
53
|
+
max-width: 100%;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.human-readable-pane__frame--markdown img,
|
|
58
|
+
.human-readable-pane__frame--markdown video,
|
|
59
|
+
.human-readable-pane__frame--markdown canvas,
|
|
60
|
+
.human-readable-pane__frame--markdown iframe {
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
height: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.human-readable-pane__frame--markdown pre,
|
|
66
|
+
.human-readable-pane__frame--markdown code {
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
overflow-wrap: anywhere;
|
|
69
|
+
word-break: break-word;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.human-readable-pane__frame--markdown pre {
|
|
73
|
+
white-space: pre-wrap;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.human-readable-pane__frame--markdown table {
|
|
77
|
+
display: block;
|
|
78
|
+
width: 100%;
|
|
79
|
+
max-width: 100%;
|
|
80
|
+
overflow-x: auto;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.human-readable-pane__frame--markdown th,
|
|
85
|
+
.human-readable-pane__frame--markdown td {
|
|
86
|
+
white-space: normal;
|
|
87
|
+
overflow-wrap: anywhere;
|
|
88
|
+
word-break: break-word;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.human-readable-pane[data-layout='mobile'] .human-readable-pane__frame {
|
|
92
|
+
padding: 0.75rem;
|
|
93
|
+
resize: none;
|
|
94
|
+
min-width: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.human-readable-pane[data-layout='mobile'] .human-readable-pane__frame--markdown,
|
|
98
|
+
.human-readable-pane[data-layout='mobile'] .human-readable-pane__frame--plain-text {
|
|
99
|
+
overflow-wrap: anywhere;
|
|
100
|
+
word-break: break-word;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.human-readable-pane[data-layout='mobile'] .human-readable-pane__frame--iframe {
|
|
104
|
+
width: 100%;
|
|
105
|
+
max-width: 100%;
|
|
106
|
+
min-height: 16rem;
|
|
107
|
+
height: min(var(--human-readable-pane-height, 30rem), 75vh);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (max-width: 576px) {
|
|
111
|
+
.human-readable-pane__frame {
|
|
112
|
+
padding: 0.75rem;
|
|
113
|
+
resize: none;
|
|
114
|
+
min-width: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.human-readable-pane__frame--markdown,
|
|
118
|
+
.human-readable-pane__frame--plain-text {
|
|
119
|
+
overflow-wrap: anywhere;
|
|
120
|
+
word-break: break-word;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.human-readable-pane__frame--iframe {
|
|
124
|
+
width: 100%;
|
|
125
|
+
max-width: 100%;
|
|
126
|
+
min-height: 16rem;
|
|
127
|
+
height: min(var(--human-readable-pane-height, 30rem), 75vh);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataBrowserContext } from 'pane-registry';
|
|
2
|
+
import type { NamedNode } from 'rdflib';
|
|
3
|
+
import './humanReadablePane.css';
|
|
4
|
+
type HumanReadableIcon = string | Promise<string>;
|
|
5
|
+
type HumanReadablePaneDefinition = {
|
|
6
|
+
icon: (subject: NamedNode, context: DataBrowserContext) => HumanReadableIcon;
|
|
7
|
+
name: string;
|
|
8
|
+
label: (subject: NamedNode, context: DataBrowserContext) => 'view' | 'View' | null;
|
|
9
|
+
render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement;
|
|
10
|
+
};
|
|
11
|
+
declare const humanReadablePane: HumanReadablePaneDefinition;
|
|
12
|
+
export default humanReadablePane;
|
|
13
|
+
//# sourceMappingURL=humanReadablePane.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanReadablePane.d.ts","sourceRoot":"","sources":["../src/humanReadablePane.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,yBAAyB,CAAA;AAKhC,KAAK,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjD,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,CAAA;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAClF,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CAC5E,CAAA;AAsBD,QAAA,MAAM,iBAAiB,EAAE,2BAuQxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|