solid-panes 3.6.2 → 3.6.3-2095f8a9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/coverage/clover.xml +2 -2
  2. package/coverage/lcov-report/index.html +1 -1
  3. package/coverage/lcov-report/outline/index.html +1 -1
  4. package/coverage/lcov-report/outline/outlineIcons.js.html +1 -1
  5. package/coverage/lcov-report/outline/propertyViews.ts.html +1 -1
  6. package/coverage/lcov-report/outline/viewAsImage.ts.html +1 -1
  7. package/coverage/lcov-report/outline/viewAsMbox.ts.html +1 -1
  8. package/coverage/lcov-report/trustedApplications/index.html +1 -1
  9. package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +1 -1
  10. package/eslint.config.mjs +34 -0
  11. package/lib/RDFXMLPane.js +1 -2
  12. package/lib/RDFXMLPane.js.map +1 -1
  13. package/lib/argument/argumentPane.js +1 -2
  14. package/lib/argument/argumentPane.js.map +1 -1
  15. package/lib/attach/attachPane.js +1 -2
  16. package/lib/attach/attachPane.js.map +1 -1
  17. package/lib/audio/audioPane.js +1 -2
  18. package/lib/audio/audioPane.js.map +1 -1
  19. package/lib/classInstancePane.js +1 -2
  20. package/lib/classInstancePane.js.map +1 -1
  21. package/lib/dashboard/basicPreferences.js +47 -55
  22. package/lib/dashboard/basicPreferences.js.map +1 -1
  23. package/lib/dashboard/homepage.js +15 -21
  24. package/lib/dashboard/homepage.js.map +1 -1
  25. package/lib/dataContentPane.js +1 -2
  26. package/lib/dataContentPane.js.map +1 -1
  27. package/lib/defaultPane.js +1 -2
  28. package/lib/defaultPane.js.map +1 -1
  29. package/lib/dokieli/dokieliPane.js +35 -22
  30. package/lib/dokieli/dokieliPane.js.map +1 -1
  31. package/lib/form/pane.js +1 -2
  32. package/lib/form/pane.js.map +1 -1
  33. package/lib/home/homePane.js +10 -11
  34. package/lib/home/homePane.js.map +1 -1
  35. package/lib/humanReadablePane.js +34 -19
  36. package/lib/humanReadablePane.js.map +1 -1
  37. package/lib/imagePane.js +1 -2
  38. package/lib/imagePane.js.map +1 -1
  39. package/lib/index.js +1 -2
  40. package/lib/index.js.map +1 -1
  41. package/lib/mainPage/header.js +36 -43
  42. package/lib/mainPage/header.js.map +1 -1
  43. package/lib/mainPage/index.js +9 -12
  44. package/lib/mainPage/index.js.map +1 -1
  45. package/lib/microblogPane/microblogPane.js +1 -2
  46. package/lib/microblogPane/microblogPane.js.map +1 -1
  47. package/lib/n3Pane.js +1 -2
  48. package/lib/n3Pane.js.map +1 -1
  49. package/lib/outline/manager.js +161 -189
  50. package/lib/outline/manager.js.map +1 -1
  51. package/lib/outline/manager.test.js +10 -11
  52. package/lib/outline/manager.test.js.map +1 -1
  53. package/lib/outline/outlineIcons.js +1 -2
  54. package/lib/outline/outlineIcons.js.map +1 -1
  55. package/lib/outline/queryByExample.js +1 -2
  56. package/lib/outline/queryByExample.js.map +1 -1
  57. package/lib/outline/userInput.js +1 -2
  58. package/lib/outline/userInput.js.map +1 -1
  59. package/lib/outline/viewAsImage.d.ts.map +1 -1
  60. package/lib/outline/viewAsImage.js +1 -2
  61. package/lib/outline/viewAsImage.js.map +1 -1
  62. package/lib/outline/viewAsMbox.d.ts.map +1 -1
  63. package/lib/playlist/playlistPane.js +1 -2
  64. package/lib/playlist/playlistPane.js.map +1 -1
  65. package/lib/schedule/schedulePane.js +1 -2
  66. package/lib/schedule/schedulePane.js.map +1 -1
  67. package/lib/slideshow/slideshowPane.js +1 -2
  68. package/lib/slideshow/slideshowPane.js.map +1 -1
  69. package/lib/socialPane.js +1 -2
  70. package/lib/socialPane.js.map +1 -1
  71. package/lib/tabbed/tabbedPane.js +11 -12
  72. package/lib/tabbed/tabbedPane.js.map +1 -1
  73. package/lib/tableViewPane.js +1 -2
  74. package/lib/tableViewPane.js.map +1 -1
  75. package/lib/transaction/pane.js +1 -2
  76. package/lib/transaction/pane.js.map +1 -1
  77. package/lib/transaction/period.js +1 -2
  78. package/lib/transaction/period.js.map +1 -1
  79. package/lib/trip/tripPane.js +1 -2
  80. package/lib/trip/tripPane.js.map +1 -1
  81. package/lib/trustedApplications/trustedApplications.test.js +1 -2
  82. package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
  83. package/lib/trustedApplications/trustedApplications.view.js +15 -16
  84. package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
  85. package/lib/ui/pane.js +1 -2
  86. package/lib/ui/pane.js.map +1 -1
  87. package/lib/versionInfo.d.ts +16 -10
  88. package/lib/versionInfo.d.ts.map +1 -1
  89. package/lib/versionInfo.js +26 -20
  90. package/lib/versionInfo.js.map +1 -1
  91. package/lib/video/videoPane.js +1 -2
  92. package/lib/video/videoPane.js.map +1 -1
  93. package/package.json +5 -4
  94. package/src/dokieli/dokieliPane.js +32 -24
  95. package/src/humanReadablePane.js +36 -27
  96. package/src/versionInfo.ts +26 -20
@@ -45,7 +45,7 @@ const humanReadablePane = {
45
45
 
46
46
  // This data could come from a fetch OR from ldp container
47
47
  const hasContentTypeIn2 = function (kb, x, displayables) {
48
- const t = kb.findTypeURIs(subject)
48
+ const t = kb.findTypeURIs(x)
49
49
  for (let k = 0; k < displayables.length; k++) {
50
50
  if (Util.mediaTypeClass(displayables[k]).uri in t) {
51
51
  return true
@@ -75,7 +75,7 @@ const humanReadablePane = {
75
75
  const kb = context.session.store
76
76
 
77
77
  const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')
78
- const ct = cts ? cts[0] : null
78
+ const ct = cts ? cts[0].split(';', 1)[0].trim() : null // remove content-type parameters
79
79
  if (ct) {
80
80
  // console.log('humanReadablePane: c-t:' + ct)
81
81
  } else {
@@ -87,6 +87,22 @@ const humanReadablePane = {
87
87
  const element = ct === 'text/markdown' ? 'DIV' : 'IFRAME'
88
88
  const frame = myDocument.createElement(element)
89
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
+
90
106
  // render markdown to html
91
107
  const markdownHtml = function () {
92
108
  kb.fetcher.webOperation('GET', subject.uri).then(response => {
@@ -97,39 +113,32 @@ const humanReadablePane = {
97
113
  frame.innerHTML = clean
98
114
  frame.setAttribute('class', 'doc')
99
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>'
100
119
  })
101
120
  }
102
121
 
103
122
  if (ct === 'text/markdown') {
104
123
  markdownHtml()
105
124
  } else {
106
- // get with authenticated fetch
107
- kb.fetcher._fetch(subject.uri)
108
- .then(function(response) {
109
- return response.blob()
110
- })
111
- .then(function(blob) {
112
- const objectURL = URL.createObjectURL(blob)
113
- frame.setAttribute('src', objectURL)
114
- frame.setAttribute('type', blob.type)
115
- frame.setAttribute('class', 'doc')
116
- return blob.type.startsWith('text') ? blob.text() : ''
117
- })
118
- .then(function(blobText) {
119
- const newLines = blobText.includes('<script src="https://dokie.li/scripts/dokieli.js">') ? -10 : 5
120
- const lines = Math.min(30, blobText.split(/\n/).length + newLines)
121
- frame.setAttribute('style', `border: 1px solid; padding: 1em; height:${lines}em; width:800px; resize: both; overflow: auto;`)
122
- })
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
+ })
123
140
  }
124
141
 
125
- // @@ Note below - if we set ANY sandbox, then Chrome and Safari won't display it if it is PDF.
126
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
127
- // You can't have any sandbox and allow plugins.
128
- // We could sandbox only HTML files I suppose.
129
- // HTML5 bug: https://lists.w3.org/Archives/Public/public-html/2011Jun/0330.html
130
-
131
- // iframe.setAttribute('sandbox', 'allow-same-origin allow-forms'); // allow-scripts ?? no documents should be static
132
-
133
142
  const tr = myDocument.createElement('TR')
134
143
  tr.appendChild(frame)
135
144
  div.appendChild(tr)
@@ -1,26 +1,32 @@
1
1
  export default {
2
- buildTime: "2025-02-05T10:12:21Z",
3
- commit: "65d80a4a704e8b79647cd2bc4b9985e9659a326e",
2
+ buildTime: "2025-08-12T10:14:46Z",
3
+ commit: "2095f8a973ba142b9e67784c75404bc3b0448394",
4
4
  npmInfo:
5
5
  {
6
- 'solid-panes': '3.6.2',
6
+ 'solid-panes': '3.6.3',
7
7
  npm: '8.19.4',
8
- node: '16.20.2',
9
- v8: '9.4.146.26-node.26',
10
- uv: '1.43.0',
11
- zlib: '1.2.11',
12
- brotli: '1.0.9',
13
- ares: '1.19.1',
14
- modules: '93',
15
- nghttp2: '1.47.0',
16
- napi: '8',
17
- llhttp: '6.0.11',
18
- openssl: '1.1.1v+quic',
19
- cldr: '41.0',
20
- icu: '71.1',
21
- tz: '2022f',
22
- unicode: '14.0',
23
- ngtcp2: '0.8.1',
24
- nghttp3: '0.7.0'
8
+ node: '20.19.4',
9
+ acorn: '8.14.0',
10
+ ada: '2.9.2',
11
+ ares: '1.34.5',
12
+ brotli: '1.1.0',
13
+ cjs_module_lexer: '1.4.1',
14
+ cldr: '47.0',
15
+ icu: '77.1',
16
+ llhttp: '9.2.1',
17
+ modules: '115',
18
+ napi: '9',
19
+ nghttp2: '1.61.0',
20
+ nghttp3: '0.7.0',
21
+ ngtcp2: '1.1.0',
22
+ openssl: '3.0.15+quic',
23
+ simdutf: '6.4.2',
24
+ tz: '2025b',
25
+ undici: '6.21.2',
26
+ unicode: '16.0',
27
+ uv: '1.46.0',
28
+ uvwasi: '0.0.21',
29
+ v8: '11.3.244.8-node.29',
30
+ zlib: '1.3.0.1-motley-82a5fec'
25
31
  }
26
32
  };