issue-pane 2.4.20-e157e68e → 2.4.20-ed8394f2

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/csvButton.js CHANGED
@@ -7,15 +7,16 @@
7
7
  import { icons, ns, utils, widgets } from 'solid-ui'
8
8
  import { store } from 'solid-logic'
9
9
 
10
+ export function quoteString(value) {
11
+ // https://www.rfc-editor.org/rfc/rfc4180
12
+ const stripped = value.replace('\n', ' ')
13
+ if (!stripped.includes(',')) {
14
+ return stripped
15
+ } // If contains comma then put in quotes and double up internal quotes
16
+ return '"' + stripped.replace('"', '""') + '"'
17
+ }
18
+
10
19
  export function csvText(store, tracker) {
11
- function encode(value) {
12
- // https://www.rfc-editor.org/rfc/rfc4180
13
- const stripped = value.replace('\n', ' ')
14
- if (!stripped.contains(',')) {
15
- return stripped
16
- } // If contains comma then put in quotes and double up internal quotes
17
- return '"' + stripped.replace('"', '""') + '"'
18
- }
19
20
 
20
21
  function columnText(task, column) {
21
22
  let thing
@@ -25,11 +26,13 @@ export function csvText(store, tracker) {
25
26
  else if (column.category) {
26
27
  const types = store.each(task, ns.rdf('type'))
27
28
  for (const t of types) {
29
+ console.log('@@ checking subclass type: ', t, ' category: ', column.category )
28
30
  if (store.holds(t, ns.rdfs('subClassOf'), column.category)){
29
31
  thing = t
30
32
  }
31
33
  }
32
- if (!thing) throw new Error('wot no category', column.category)
34
+ if (!thing) return '?' + utils.label(column.category) // @@
35
+ if (!thing) throw new Error('wot no class of category ', column.category)
33
36
  } else {
34
37
  throw new Error('wot no pred or cat', column)
35
38
  }
@@ -38,12 +41,12 @@ export function csvText(store, tracker) {
38
41
 
39
42
  function taskLine(task) {
40
43
  return columns.map(column => columnText(task, column))
41
- .map(encode)
44
+ .map(quoteString)
42
45
  .join(',')
43
46
  + '/n'
44
47
  }
45
48
  const stateStore = store.any(tracker, ns.wf('stateStore'))
46
- const tasks = store.any(null, ns.wf('tracker'), tracker, stateStore)
49
+ const tasks = store.each(null, ns.wf('tracker'), tracker, stateStore)
47
50
 
48
51
  let columns = [
49
52
  /* like:
@@ -52,12 +55,18 @@ export function csvText(store, tracker) {
52
55
  */
53
56
  ]
54
57
  const states = store.any(tracker, ns.wf('issueClass')) // Main states are subclasses of this class
55
- const categories = store.each(tracker, ns.wf('issueCategory')) | []
56
- const classifications = [states ] + categories
57
- for (const c in classifications){
58
+ console.log(' CSV: States - main superclass:', states)
59
+
60
+ const categories = store.each(tracker, ns.wf('issueCategory'))
61
+ console.log(' CSV: Categories : ', categories )
62
+ console.log(' CSV: Categories : length: ', categories.length)
63
+ console.log(' CSV: Categories : first: ', categories[0])
64
+
65
+ const classifications = [states].concat(categories)
66
+ for (const c of classifications){
58
67
  const column = { label: utils.label(c), category: c}
59
68
  console.log(' CSV: found column from classifications', column)
60
- columns.append(column) // Classes are different
69
+ columns.push(column) // Classes are different
61
70
  }
62
71
 
63
72
  // const propertyList = ns.wf('propertyList')
@@ -70,7 +79,7 @@ export function csvText(store, tracker) {
70
79
  const lab = utils.label(prop)
71
80
  const column = {label: lab, predicate: prop}
72
81
  console.log(' CSV: found column from form', column)
73
- columns.append(column)
82
+ columns.push(column)
74
83
  }
75
84
  }
76
85
  const header = columns.map(col => col.label).join(',') + '\n'
package/dev/context.js ADDED
@@ -0,0 +1,19 @@
1
+ // import { longChatPane } from "chat-pane";
2
+ import { DataBrowserContext, PaneRegistry } from "pane-registry";
3
+ import { LiveStore, solidLogicSingleton, store } from "solid-logic";
4
+
5
+ export const context = {
6
+ session: {
7
+ store: store,
8
+ paneRegistry: {
9
+ byName: (name) => {
10
+ return // longChatPane
11
+ }
12
+ },
13
+ logic : solidLogicSingleton
14
+ },
15
+ dom: document,
16
+ getOutliner: () => null,
17
+ };
18
+
19
+ export const fetcher = store.fetcher;
package/dev/index.html ADDED
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>issue-pane dev server</title>
6
+ <style>
7
+ body {
8
+ margin: 0;
9
+ font-family: sans-serif;
10
+ }
11
+ h1 {
12
+ padding: 0.5rem;
13
+ margin: 0;
14
+ color: #666;
15
+ }
16
+ #loginBanner {
17
+ display: grid;
18
+ padding: 0.5rem;
19
+ grid-gap: 1rem;
20
+ grid-auto-flow: column;
21
+ justify-content: flex-start;
22
+ align-items: center;
23
+ }
24
+ .banner {
25
+ margin: 0;
26
+ height: 1rem;
27
+ width: 100%;
28
+ background: repeating-linear-gradient(
29
+ -45deg,
30
+ #ffffff,
31
+ #d8d9d5 20px,
32
+ #d41717 20px,
33
+ #984646 40px
34
+ );
35
+ }
36
+ </style>
37
+ </head>
38
+ <body>
39
+ <h1>pane under development</h1>
40
+ <div>
41
+ <div id="webId"></div>
42
+ </div>
43
+ <div id="loginBanner"></div>
44
+ <div class="banner"></div>
45
+ <div id="app">Rendering...</div>
46
+ </body>
47
+ </html>
package/dev/index.js ADDED
@@ -0,0 +1,37 @@
1
+ import { sym } from "rdflib";
2
+ import { default as pane } from "..";
3
+ import { context, fetcher } from "./context";
4
+ import { authn, authSession } from "solid-logic";
5
+ import * as UI from "solid-ui";
6
+
7
+ const loginBanner = document.getElementById("loginBanner");
8
+ const webId = document.getElementById("webId");
9
+
10
+ loginBanner.appendChild(UI.login.loginStatusBox(document, null, {}));
11
+
12
+ async function finishLogin() {
13
+ await authSession.handleIncomingRedirect();
14
+ const session = authSession;
15
+ if (session.info.isLoggedIn) {
16
+ // Update the page with the status.
17
+ webId.innerHTML = "Logged in as: " + authn.currentUser().uri;
18
+ } else {
19
+ webId.innerHTML = "";
20
+ }
21
+ }
22
+
23
+ finishLogin();
24
+
25
+
26
+ // https://testingsolidos.solidcommunity.net/profile/card#me
27
+ // https://timbl.solidcommunity.net/profile/card#me
28
+ //
29
+ // const targetURIToShow = "https://angelo.veltens.org/profile/card#me";
30
+ // const targetURIToShow = "https://testingsolidos.solidcommunity.net/profile/card#me";
31
+ // const targetURIToShow = "https://timbl.solidcommunity.net/profile/card#me";
32
+ const targetURIToShow = "https://solidproject.solidcommunity.net/Roadmap/index.ttl#this";
33
+
34
+ fetcher.load(targetURIToShow).then(() => {
35
+ const app = pane.render(sym(targetURIToShow), context);
36
+ document.getElementById("app").replaceWith(app);
37
+ });
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "issue-pane",
3
- "version": "2.4.20-e157e68e",
3
+ "version": "2.4.20-ed8394f2",
4
4
  "description": "Solid-compatible Panes: issue editor",
5
5
  "main": "./issuePane.js",
6
6
  "scripts": {
7
7
  "build": "echo nothing to build",
8
8
  "lint": "eslint '*.js'",
9
9
  "lint-fix": "eslint '*.js' --fix",
10
+ "start": "webpack serve --config webpack.dev.config.js --open",
10
11
  "test": "npm run lint",
11
12
  "ignore:prepublishOnly": "npm test",
12
13
  "ignore:postpublish": "git push origin main --follow-tags"
@@ -40,11 +41,16 @@
40
41
  "@eslint/compat": "^1.2.6",
41
42
  "@eslint/eslintrc": "^3.2.0",
42
43
  "@eslint/js": "^9.19.0",
44
+ "babel-loader": "^10.0.0",
43
45
  "eslint": "^9.19.0",
44
46
  "eslint-plugin-import": "^2.31.0",
45
47
  "globals": "^15.14.0",
48
+ "html-webpack-plugin": "^5.6.3",
46
49
  "husky": "^9.1.7",
47
- "lint-staged": "^15.4.3"
50
+ "lint-staged": "^15.4.3",
51
+ "node-polyfill-webpack-plugin": "^4.1.0",
52
+ "webpack-cli": "^6.0.1",
53
+ "webpack-dev-server": "^4.15.2"
48
54
  },
49
55
  "husky": {
50
56
  "hooks": {
@@ -0,0 +1,36 @@
1
+ const HtmlWebpackPlugin = require("html-webpack-plugin");
2
+ const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
3
+
4
+ module.exports = [
5
+ {
6
+ mode: "development",
7
+ entry: ["./dev/index.js"], // was .ts
8
+ plugins: [
9
+ new HtmlWebpackPlugin({ template: "./dev/index.html" }),
10
+ new NodePolyfillPlugin()
11
+ ],
12
+ module: {
13
+ rules: [
14
+ {
15
+ test: /\.(js|ts)$/,
16
+ exclude: /node_modules/,
17
+ use: ["babel-loader"],
18
+ },
19
+
20
+ {
21
+ test: /\.ttl$/, // Target text files
22
+ type: 'asset/source', // Load the file's content as a string
23
+ },
24
+
25
+ ],
26
+ },
27
+ resolve: {
28
+ extensions: ["*", ".js", ".ts"]
29
+ },
30
+
31
+ devServer: {
32
+ static: './dist'
33
+ },
34
+ devtool: "source-map",
35
+ },
36
+ ];