mashlib 2.0.0-b6e2711c → 2.0.0-c633331d
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/browse-test.html +11 -0
- package/dist/browse.html +22 -9
- package/dist/mashlib.js +76 -32
- package/dist/mashlib.js.map +1 -1
- package/dist/mashlib.min.js +10 -10
- package/dist/mashlib.min.js.map +1 -1
- package/package.json +6 -5
package/dist/browse-test.html
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
<html id="docHTML">
|
|
3
3
|
<head>
|
|
4
4
|
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
|
5
|
+
<script>
|
|
6
|
+
// Suppress harmless ResizeObserver loop errors that block the UI
|
|
7
|
+
window.addEventListener('error', function(e) {
|
|
8
|
+
if (e.message && e.message.includes('ResizeObserver loop')) {
|
|
9
|
+
e.stopImmediatePropagation();
|
|
10
|
+
e.stopPropagation();
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}, true);
|
|
15
|
+
</script>
|
|
5
16
|
<link type="text/css" rel="stylesheet" href="mash.css" />
|
|
6
17
|
<script type="text/javascript" src="mashlib.js"></script>
|
|
7
18
|
<script>
|
package/dist/browse.html
CHANGED
|
@@ -2,15 +2,27 @@
|
|
|
2
2
|
<html id="docHTML">
|
|
3
3
|
<head>
|
|
4
4
|
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
|
5
|
+
<script>
|
|
6
|
+
// Suppress harmless ResizeObserver loop errors that block the UI
|
|
7
|
+
window.addEventListener('error', function(e) {
|
|
8
|
+
if (e.message && e.message.includes('ResizeObserver loop')) {
|
|
9
|
+
e.stopImmediatePropagation();
|
|
10
|
+
e.stopPropagation();
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}, true);
|
|
15
|
+
</script>
|
|
5
16
|
<link type="text/css" rel="stylesheet" href="mash.css" />
|
|
6
|
-
<script type="text/javascript" src="mashlib.
|
|
17
|
+
<script type="text/javascript" src="mashlib.js"></script>
|
|
7
18
|
<script>
|
|
8
19
|
document.addEventListener('DOMContentLoaded', function() {
|
|
9
20
|
const authn = SolidLogic.authn
|
|
10
|
-
const authSession = SolidLogic.
|
|
21
|
+
const authSession = SolidLogic.authSession
|
|
11
22
|
const store = SolidLogic.store
|
|
12
23
|
const dom = document
|
|
13
|
-
|
|
24
|
+
// Disable cross-site proxy - modern Solid servers support CORS
|
|
25
|
+
// $rdf.Fetcher.crossSiteProxyTemplate = self.origin + '/xss?uri={uri}'
|
|
14
26
|
const uri = window.location.href
|
|
15
27
|
window.document.title = 'SolidOS Web App: ' + uri
|
|
16
28
|
const outliner = panes.getOutliner(dom) //function from solid-panes
|
|
@@ -59,11 +71,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
59
71
|
const logoutButton = loginButtonArea.querySelector('input');
|
|
60
72
|
logoutButton.value = "Logout";
|
|
61
73
|
let displayId = `<${me.value}>`;
|
|
62
|
-
webIdArea.innerHTML = displayId;
|
|
63
|
-
banner.style.backgroundColor="#bbccbb";
|
|
74
|
+
webIdArea.innerHTML = displayId;
|
|
75
|
+
banner.style.backgroundColor="#bbccbb";
|
|
64
76
|
} else {
|
|
65
77
|
banner.style.backgroundColor="#ccbbbb";
|
|
66
|
-
}
|
|
78
|
+
}
|
|
67
79
|
loginButtonArea.style.display="inline-block";
|
|
68
80
|
}
|
|
69
81
|
|
|
@@ -81,7 +93,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
81
93
|
mungeLoginArea();
|
|
82
94
|
go()
|
|
83
95
|
})
|
|
84
|
-
}
|
|
96
|
+
}
|
|
85
97
|
mungeLoginArea();
|
|
86
98
|
});
|
|
87
99
|
</script>
|
|
@@ -93,6 +105,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
93
105
|
The SolidOS Databrowser
|
|
94
106
|
</header>
|
|
95
107
|
<main id="mainContent" tabindex="-1">
|
|
108
|
+
|
|
96
109
|
<div class="input-row" id="inputArea">
|
|
97
110
|
Viewing <input id="uriField" type="text" class="uri-field" placeholder="enter a pod address e.g. https://you.solidcommunity.net/"/> <input type="button" id="goButton" value="Go" />
|
|
98
111
|
</div>
|
|
@@ -124,10 +137,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
124
137
|
width:100%;
|
|
125
138
|
padding:1em;
|
|
126
139
|
background-color:#ccbbbb;
|
|
127
|
-
margin-bottom:0.6em;
|
|
128
140
|
}
|
|
129
141
|
.input-row {
|
|
130
|
-
|
|
142
|
+
padding-left:1em;
|
|
143
|
+
padding-bottom:1em;
|
|
131
144
|
}
|
|
132
145
|
.user-row {
|
|
133
146
|
margin-top:0.5em;
|
package/dist/mashlib.js
CHANGED
|
@@ -6266,7 +6266,7 @@ function _defineProperty(e, r, t) {
|
|
|
6266
6266
|
/**
|
|
6267
6267
|
* Default signup endpoints (list of identity providers)
|
|
6268
6268
|
*/
|
|
6269
|
-
signupEndpoint: 'https://solidproject.org/
|
|
6269
|
+
signupEndpoint: 'https://solidproject.org/get_a_pod',
|
|
6270
6270
|
/**
|
|
6271
6271
|
* Default height of the Signup popup window, in pixels
|
|
6272
6272
|
*/
|
|
@@ -44313,6 +44313,10 @@ const dataContentPane = exports.dataContentPane = {
|
|
|
44313
44313
|
name: 'dataContents',
|
|
44314
44314
|
audience: [ns.solid('Developer')],
|
|
44315
44315
|
label: function (subject, context) {
|
|
44316
|
+
// Don't match markdown files - let humanReadablePane handle those
|
|
44317
|
+
if (subject.uri && (subject.uri.endsWith('.md') || subject.uri.endsWith('.markdown'))) {
|
|
44318
|
+
return null;
|
|
44319
|
+
}
|
|
44316
44320
|
if ('http://www.w3.org/2007/ont/link#ProtocolEvent' in context.session.store.findTypeURIs(subject)) {
|
|
44317
44321
|
return null;
|
|
44318
44322
|
}
|
|
@@ -48489,6 +48493,11 @@ var _default = exports["default"] = {
|
|
|
48489
48493
|
};
|
|
48490
48494
|
if (!subject.uri) return null; // no bnodes
|
|
48491
48495
|
|
|
48496
|
+
// Don't match markdown files - let humanReadablePane handle those
|
|
48497
|
+
const uri = subject.uri;
|
|
48498
|
+
if (uri.endsWith('.md') || uri.endsWith('.markdown')) {
|
|
48499
|
+
return null;
|
|
48500
|
+
}
|
|
48492
48501
|
const t = kb.findTypeURIs(subject);
|
|
48493
48502
|
if (t[ns.link('WebPage').uri]) return 'view';
|
|
48494
48503
|
if (hasContentTypeIn(kb, subject, allowed) || hasContentTypeIn2(kb, subject, allowed)) {
|
|
@@ -55012,7 +55021,7 @@ __webpack_require__(1594);
|
|
|
55012
55021
|
let buttonContainer = document.createElement('section');
|
|
55013
55022
|
const addMeToYourFriendsDiv = (subject, context) => {
|
|
55014
55023
|
buttonContainer = context.dom.createElement('section');
|
|
55015
|
-
buttonContainer.setAttribute('class', 'buttonSubSection text-truncate text-center
|
|
55024
|
+
buttonContainer.setAttribute('class', 'buttonSubSection text-truncate text-center section-centered');
|
|
55016
55025
|
buttonContainer.setAttribute('aria-labelledby', 'add-me-to-your-friends-button-section');
|
|
55017
55026
|
buttonContainer.setAttribute('data-testid', 'button');
|
|
55018
55027
|
|
|
@@ -55025,7 +55034,7 @@ const addMeToYourFriendsDiv = (subject, context) => {
|
|
|
55025
55034
|
const button = createAddMeToYourFriendsButton(subject, context);
|
|
55026
55035
|
button.classList.add('actionButton', 'btn-primary', 'action-button-focus');
|
|
55027
55036
|
buttonContainer.appendChild(button);
|
|
55028
|
-
return (0, _litHtml.html)
|
|
55037
|
+
return (0, _litHtml.html)`${buttonContainer}`;
|
|
55029
55038
|
};
|
|
55030
55039
|
exports.addMeToYourFriendsDiv = addMeToYourFriendsDiv;
|
|
55031
55040
|
const createAddMeToYourFriendsButton = (subject, context) => {
|
|
@@ -55330,7 +55339,7 @@ const ChatWithMe = (subject, context) => {
|
|
|
55330
55339
|
let exists;
|
|
55331
55340
|
try {
|
|
55332
55341
|
yield (0, _litHtml.html)`
|
|
55333
|
-
<div class="buttonSubSection
|
|
55342
|
+
<div class="buttonSubSection">
|
|
55334
55343
|
<div class="actionButton loading-text center" role="status" aria-live="polite">
|
|
55335
55344
|
${_texts.loadingMessage.toUpperCase()}
|
|
55336
55345
|
</div>
|
|
@@ -56442,8 +56451,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
56442
56451
|
}));
|
|
56443
56452
|
exports["default"] = void 0;
|
|
56444
56453
|
var _default = exports["default"] = {
|
|
56445
|
-
buildTime: '2026-01-
|
|
56446
|
-
commit: '
|
|
56454
|
+
buildTime: '2026-01-29T11:13:04Z',
|
|
56455
|
+
commit: 'bab16e7219fe8a05adbcf449ae865462bf5fc6b2',
|
|
56447
56456
|
npmInfo: {
|
|
56448
56457
|
'solid-panes': '4.0.0-newStyle',
|
|
56449
56458
|
npm: '10.8.2',
|
|
@@ -67803,6 +67812,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
67803
67812
|
** This is for peeking at a page, because the user might not want to leave the data browser.
|
|
67804
67813
|
*/
|
|
67805
67814
|
|
|
67815
|
+
// Helper function to check if a URI has a markdown file extension
|
|
67816
|
+
const isMarkdownFile = uri => {
|
|
67817
|
+
if (!uri) return false;
|
|
67818
|
+
const path = uri.split('?')[0].split('#')[0]; // Remove query string and fragment
|
|
67819
|
+
return /\.(md|markdown|mdown|mkd|mkdn)$/i.test(path);
|
|
67820
|
+
};
|
|
67806
67821
|
const humanReadablePane = {
|
|
67807
67822
|
icon: _solidUi.icons.originalIconBase + 'tango/22-text-x-generic.png',
|
|
67808
67823
|
name: 'humanReadable',
|
|
@@ -67840,6 +67855,11 @@ const humanReadablePane = {
|
|
|
67840
67855
|
|
|
67841
67856
|
const t = kb.findTypeURIs(subject);
|
|
67842
67857
|
if (t[_solidUi.ns.link('WebPage').uri]) return 'view';
|
|
67858
|
+
|
|
67859
|
+
// Check file extension for markdown files
|
|
67860
|
+
if (isMarkdownFile(subject.uri)) {
|
|
67861
|
+
return 'View';
|
|
67862
|
+
}
|
|
67843
67863
|
if (hasContentTypeIn(kb, subject, allowed) || hasContentTypeIn2(kb, subject, allowed)) {
|
|
67844
67864
|
return 'View';
|
|
67845
67865
|
}
|
|
@@ -67851,6 +67871,9 @@ const humanReadablePane = {
|
|
|
67851
67871
|
const kb = context.session.store;
|
|
67852
67872
|
const cts = kb.fetcher.getHeader(subject.doc(), 'content-type');
|
|
67853
67873
|
const ct = cts ? cts[0].split(';', 1)[0].trim() : null; // remove content-type parameters
|
|
67874
|
+
|
|
67875
|
+
// Fallback: detect markdown by file extension if content-type is not text/markdown
|
|
67876
|
+
const isMarkdown = ct === 'text/markdown' || isMarkdownFile(subject.uri);
|
|
67854
67877
|
if (ct) {
|
|
67855
67878
|
// console.log('humanReadablePane: c-t:' + ct)
|
|
67856
67879
|
} else {
|
|
@@ -67859,8 +67882,22 @@ const humanReadablePane = {
|
|
|
67859
67882
|
|
|
67860
67883
|
// @@ When we can, use CSP to turn off scripts within the iframe
|
|
67861
67884
|
div.setAttribute('class', 'docView');
|
|
67862
|
-
|
|
67863
|
-
|
|
67885
|
+
|
|
67886
|
+
// render markdown to html in a DIV element
|
|
67887
|
+
const renderMarkdownContent = function (frame) {
|
|
67888
|
+
kb.fetcher.webOperation('GET', subject.uri).then(response => {
|
|
67889
|
+
const markdownText = response.responseText;
|
|
67890
|
+
const lines = Math.min(30, markdownText.split(/\n/).length + 5);
|
|
67891
|
+
const res = _marked.marked.parse(markdownText);
|
|
67892
|
+
const clean = _dompurify.default.sanitize(res);
|
|
67893
|
+
frame.innerHTML = clean;
|
|
67894
|
+
frame.setAttribute('class', 'doc');
|
|
67895
|
+
frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`);
|
|
67896
|
+
}).catch(error => {
|
|
67897
|
+
console.error('Error fetching markdown content:', error);
|
|
67898
|
+
frame.innerHTML = '<p>Error loading content</p>';
|
|
67899
|
+
});
|
|
67900
|
+
};
|
|
67864
67901
|
const setIframeAttributes = (frame, blob, lines) => {
|
|
67865
67902
|
frame.setAttribute('src', URL.createObjectURL(blob));
|
|
67866
67903
|
frame.setAttribute('type', blob.type);
|
|
@@ -67876,25 +67913,16 @@ const humanReadablePane = {
|
|
|
67876
67913
|
frame.setAttribute('sandbox', 'allow-scripts allow-same-origin');
|
|
67877
67914
|
}
|
|
67878
67915
|
};
|
|
67879
|
-
|
|
67880
|
-
|
|
67881
|
-
|
|
67882
|
-
|
|
67883
|
-
|
|
67884
|
-
|
|
67885
|
-
|
|
67886
|
-
const clean = _dompurify.default.sanitize(res);
|
|
67887
|
-
frame.innerHTML = clean;
|
|
67888
|
-
frame.setAttribute('class', 'doc');
|
|
67889
|
-
frame.setAttribute('style', `border: 1px solid; padding: 1em; height: ${lines}em; width: 800px; resize: both; overflow: auto;`);
|
|
67890
|
-
}).catch(error => {
|
|
67891
|
-
console.error('Error fetching markdown content:', error);
|
|
67892
|
-
frame.innerHTML = '<p>Error loading content</p>';
|
|
67893
|
-
});
|
|
67894
|
-
};
|
|
67895
|
-
if (ct === 'text/markdown') {
|
|
67896
|
-
markdownHtml();
|
|
67916
|
+
if (isMarkdown) {
|
|
67917
|
+
// For markdown, use a DIV element and render the content
|
|
67918
|
+
const frame = myDocument.createElement('DIV');
|
|
67919
|
+
renderMarkdownContent(frame);
|
|
67920
|
+
const tr = myDocument.createElement('TR');
|
|
67921
|
+
tr.appendChild(frame);
|
|
67922
|
+
div.appendChild(tr);
|
|
67897
67923
|
} else {
|
|
67924
|
+
// For other content types, use IFRAME
|
|
67925
|
+
const frame = myDocument.createElement('IFRAME');
|
|
67898
67926
|
// Fetch and process the blob
|
|
67899
67927
|
kb.fetcher._fetch(subject.uri).then(response => response.blob()).then(blob => {
|
|
67900
67928
|
const blobTextPromise = blob.type.startsWith('text') ? blob.text() : Promise.resolve('');
|
|
@@ -67908,14 +67936,22 @@ const humanReadablePane = {
|
|
|
67908
67936
|
}) => {
|
|
67909
67937
|
const newLines = blobText.includes('<script src="https://dokie.li/scripts/dokieli.js">') ? -10 : 5;
|
|
67910
67938
|
const lines = Math.min(30, blobText.split(/\n/).length + newLines);
|
|
67911
|
-
|
|
67939
|
+
// For text content, create a new blob with proper charset to avoid encoding warnings
|
|
67940
|
+
if (blob.type.startsWith('text/') && !blob.type.includes('charset')) {
|
|
67941
|
+
const newBlob = new Blob([blobText], {
|
|
67942
|
+
type: blob.type + '; charset=utf-8'
|
|
67943
|
+
});
|
|
67944
|
+
setIframeAttributes(frame, newBlob, lines);
|
|
67945
|
+
} else {
|
|
67946
|
+
setIframeAttributes(frame, blob, lines);
|
|
67947
|
+
}
|
|
67912
67948
|
}).catch(err => {
|
|
67913
67949
|
console.log('Error fetching or processing blob:', err);
|
|
67914
67950
|
});
|
|
67951
|
+
const tr = myDocument.createElement('TR');
|
|
67952
|
+
tr.appendChild(frame);
|
|
67953
|
+
div.appendChild(tr);
|
|
67915
67954
|
}
|
|
67916
|
-
const tr = myDocument.createElement('TR');
|
|
67917
|
-
tr.appendChild(frame);
|
|
67918
|
-
div.appendChild(tr);
|
|
67919
67955
|
return div;
|
|
67920
67956
|
}
|
|
67921
67957
|
};
|
|
@@ -70214,6 +70250,10 @@ const n3Pane = exports.n3Pane = {
|
|
|
70214
70250
|
name: 'n3',
|
|
70215
70251
|
audience: [ns.solid('Developer')],
|
|
70216
70252
|
label: function (subject, context) {
|
|
70253
|
+
// Don't match markdown files - let humanReadablePane handle those
|
|
70254
|
+
if (subject.uri && (subject.uri.endsWith('.md') || subject.uri.endsWith('.markdown'))) {
|
|
70255
|
+
return null;
|
|
70256
|
+
}
|
|
70217
70257
|
const store = context.session.store;
|
|
70218
70258
|
if ('http://www.w3.org/2007/ont/link#ProtocolEvent' in store.findTypeURIs(subject)) {
|
|
70219
70259
|
return null;
|
|
@@ -93553,6 +93593,10 @@ const RDFXMLPane = exports.RDFXMLPane = {
|
|
|
93553
93593
|
name: 'RDFXML',
|
|
93554
93594
|
audience: [ns.solid('Developer')],
|
|
93555
93595
|
label: function (subject, context) {
|
|
93596
|
+
// Don't match markdown files - let humanReadablePane handle those
|
|
93597
|
+
if (subject.uri && (subject.uri.endsWith('.md') || subject.uri.endsWith('.markdown'))) {
|
|
93598
|
+
return null;
|
|
93599
|
+
}
|
|
93556
93600
|
const store = context.session.store;
|
|
93557
93601
|
if ('http://www.w3.org/2007/ont/link#ProtocolEvent' in store.findTypeURIs(subject)) {
|
|
93558
93602
|
return null;
|
|
@@ -113915,8 +113959,8 @@ var dist = __webpack_require__(7523);
|
|
|
113915
113959
|
var solid_logic_esm = __webpack_require__(9332);
|
|
113916
113960
|
;// ./src/versionInfo.ts
|
|
113917
113961
|
/* harmony default export */ const versionInfo = ({
|
|
113918
|
-
buildTime: '2026-01-
|
|
113919
|
-
commit: '
|
|
113962
|
+
buildTime: '2026-01-29T15:21:59Z',
|
|
113963
|
+
commit: 'c633331d790a2072ca94487cf448108b57161e57',
|
|
113920
113964
|
npmInfo: {
|
|
113921
113965
|
'mashlib': '2.0.0',
|
|
113922
113966
|
'npm': '10.8.2',
|