Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat thread with proof #550

Merged
merged 71 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f57eb86
Had to drop node to 16 for tests to work. See https://github.com/node…
timbl Feb 21, 2023
99d93f1
tests work only node 16. starting thread stuff
timbl Feb 22, 2023
a3df52b
Ass new icon for Reply
timbl Feb 24, 2023
ef62741
Thread display is basically working
timbl Feb 28, 2023
24320e3
Make new messages on thread etc
timbl Feb 28, 2023
372f872
async
timbl Mar 2, 2023
d577e51
lint issues
bourgeoa Mar 9, 2023
78404ed
merge main
bourgeoa Mar 9, 2023
a27cf0c
update messageTools.test.ts
bourgeoa Mar 9, 2023
86be5ab
skip test : complains if you have multiple bookmark docs
bourgeoa Mar 9, 2023
029ae1f
update package-lock.json
bourgeoa Mar 9, 2023
047d5bd
working on sentiments
timbl Mar 9, 2023
8415fae
hand merged
timbl Mar 9, 2023
7fe156e
limit srollback on thread
timbl Mar 9, 2023
ca09f65
initially load thread at the right place in timeline
timbl Mar 13, 2023
ff562b6
remove jss in acl
timea-solid Mar 20, 2023
90e6fe9
remove jss in header and footer, move stlys of acl in main style.js
timea-solid Mar 20, 2023
3369248
cleaned buttons from jss
timea-solid Mar 20, 2023
ed5d859
improved styles
timea-solid Mar 20, 2023
d980bb0
working on removing jss
timea-solid Mar 26, 2023
9daf358
fixing some more styles
timea-solid Mar 27, 2023
76bcd5f
updated snapshots accordingly
timea-solid Mar 27, 2023
53b74ba
avoid bing caught in loops
timbl Apr 4, 2023
8e5e7ac
added transform and test options to jest config
SharonStrats Apr 8, 2023
068520e
fixed lint errors
SharonStrats Apr 8, 2023
f9e2277
Merge branch 'main' into chat-threads
SharonStrats Apr 8, 2023
2dcc5e4
fixed broken styles
timea-solid Apr 9, 2023
36cc321
Update src/chat/bookmarks.js
bourgeoa Apr 10, 2023
d81bf22
Merge branch 'style' into chat-threads
timea-solid Apr 11, 2023
99dd2a8
Update src/chat/infinite.js
timea-solid Apr 11, 2023
eb85c49
Update src/chat/bookmarks.js
timea-solid Apr 11, 2023
ce90c57
Update src/chat/bookmarks.js
timea-solid Apr 11, 2023
f3028bd
Update src/chat/messageTools.js
timea-solid Apr 11, 2023
95bf305
Update src/chat/chatLogic.js
timea-solid Apr 11, 2023
e1d1a02
Update src/chat/messageTools.js
timea-solid Apr 11, 2023
c79215f
Update src/chat/thread.js
timea-solid Apr 11, 2023
ac08160
timbl code
timbl Apr 12, 2023
265a274
merged with sharon debug()
timbl Apr 12, 2023
efb1491
unblock initial load
timbl Apr 14, 2023
c6bf02e
merge main
bourgeoa Apr 16, 2023
b8d3fd1
Merge branch 'main' into chat-threads
bourgeoa May 26, 2023
f314621
merged thread & proof main
bourgeoa May 28, 2023
cf683a6
update to chat-threads commits
bourgeoa May 29, 2023
21f105c
lint
bourgeoa May 29, 2023
7b224a5
appendCurrentMesage() in thread
bourgeoa May 30, 2023
89c74e3
find thread
bourgeoa May 30, 2023
d7f5d53
edit comment
bourgeoa May 31, 2023
82276a6
updateMany
bourgeoa May 31, 2023
99da6a0
typing error
bourgeoa May 31, 2023
97b9e30
dist
bourgeoa May 31, 2023
1a4db38
moved root logic to own file
SharonStrats Jun 1, 2023
539c802
key tests
SharonStrats Jun 1, 2023
e5cde85
Merge branch 'main' into chat-thread-proof
timea-solid Jul 5, 2023
dd1547e
Merge branch 'chat-thread-proof' of https://github.com/solidos/solid-…
bourgeoa Dec 2, 2023
5744d91
Merge branch 'main' into chat-thread-proof
bourgeoa Dec 2, 2023
7c0461b
package-locj.json
bourgeoa Dec 2, 2023
6155852
Uint8Array issue
bourgeoa Dec 2, 2023
7e77c89
add jest-environment-jsdom.js
bourgeoa Dec 2, 2023
08d2a11
package-lock.json
bourgeoa Dec 3, 2023
8e703dc
privateKey Url
bourgeoa Feb 12, 2024
adfbed2
remove duplicate entries and cleanings
bourgeoa Feb 18, 2024
8d90d95
missing package-lock.json
bourgeoa Feb 18, 2024
74410c5
update minor dependencies
bourgeoa Mar 24, 2024
642b62a
nvmrc node v18.19.0
bourgeoa Mar 24, 2024
d1f9ae5
solid-dependencies
bourgeoa Mar 24, 2024
449dd33
2.4.33-beta
bourgeoa Mar 24, 2024
b5940ed
solidos dependencies
bourgeoa Mar 28, 2024
6e93e6b
2.4.33-beta3
bourgeoa Mar 28, 2024
b5bcb9e
solidos dependencies
bourgeoa Mar 28, 2024
4497ebd
2.4.33-beta4
bourgeoa Mar 28, 2024
17f11db
update dependencies
bourgeoa Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.0
v18.19.0
18 changes: 18 additions & 0 deletions jest-environment-jsdom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { TextEncoder, TextDecoder } = require('util')
const JSDOMEnvironmentBase = require('jest-environment-jsdom')

Object.defineProperty(exports, '__esModule', {
value: true,
})

class JSDOMEnvironment extends JSDOMEnvironmentBase {
constructor(...args) {
const { global } = super(...args)
global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder
global.Uint8Array = Uint8Array
}
}

exports.default = JSDOMEnvironment
exports.TestEnvironment = JSDOMEnvironment;
10 changes: 8 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
// https://github.com/paralleldrive/cuid2/issues/44#issuecomment-1531731695
testEnvironment: './jest-environment-jsdom.js', // had to extend; see https://github.com/jsdom/jsdom/issues/2524
testMatch: [
'**/?(*.)+(spec|test).[tj]s?(x)' ],
setupFilesAfterEnv: [
'./test/helpers/setup.ts'
]
],
transformIgnorePatterns: ["/node_modules/(?!lit-html).+\\.js"],
testEnvironmentOptions: {
customExportConditions: ['node']
}

}
28,189 changes: 1,274 additions & 26,915 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-ui",
"version": "2.4.32",
"version": "2.4.33-beta4",
"description": "UI library for writing Solid read-write-web applications",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down Expand Up @@ -55,29 +55,28 @@
},
"homepage": "https://github.com/solidos/solid-ui",
"dependencies": {
"@noble/curves": "^1.2.0",
"@noble/curves": "^1.4.0",
"acorn": "^7.4.1",
"escape-html": "^1.0.3",
"eslint-plugin-n": "^15.7.0",
"i": "^0.3.7",
"mime-types": "^2.1.35",
"npm": "^8.19.4",
"pane-registry": "^2.4.25",
"rdflib": "^2.2.33",
"solid-logic": "^3.0.6",
"pane-registry": "^2.4.26",
"solid-logic": "^3.0.7",
"solid-namespace": "^0.5.3",
"uuid": "^8.3.2"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.5",
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@babel/plugin-transform-async-to-generator": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.4",
"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.23.3",
"@babel/runtime": "^7.23.5",
"@babel/plugin-transform-async-to-generator": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/preset-typescript": "^7.24.1",
"@babel/runtime": "^7.24.1",
"@mdx-js/react": "^2.3.0",
"@storybook/addon-actions": "6.5.16",
"@storybook/addon-docs": "6.5.16",
Expand All @@ -90,34 +89,35 @@
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/jsdom": "^16.2.15",
"@types/node": "^18.19.1",
"@types/react": "^17.0.71",
"@types/node": "^18.19.26",
"@types/react": "^17.0.79",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"babel-loader": "^8.3.0",
"crypto": "^1.0.1",
"eslint": "^8.54.0",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"get-random-values": "^2.1.0",
"html-webpack-plugin": "^5.5.3",
"html-webpack-plugin": "^5.6.0",
"husky": "^7.0.4",
"isomorphic-fetch": "^3.0.0",
"jest": "^27.5.1",
"jsdom": "^19.0.0",
"jest-environment-jsdom": "^27.5.1",
"jsdom": "^16.7.0",
"lint-staged": "^12.5.0",
"nock": "^13.4.0",
"nock": "^13.5.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"ts-jest": "^27.1.5",
"typedoc": "^0.25.4",
"typedoc": "^0.25.12",
"typescript": "^4.9.5",
"webpack": "^5.89.0",
"webpack": "^5.91.0",
"webpack-cli": "^4.10.0"
},
"optionalDependencies": {
Expand Down
61 changes: 7 additions & 54 deletions src/chat/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @packageDocumentation
*/

/* global alert confirm */
import * as debug from '../debug'
import { icons } from '../iconBase'
import { media } from '../media/index'
Expand All @@ -25,53 +24,6 @@ const BOOKMARK_ICON = 'noun_45961.svg'
const label = utils.label
const dom = window.document || null

/** Create a resource if it really does not exist
* Be absolutely sure something does not exist before creating a new empty file
* as otherwise existing could be deleted.
* @param doc {NamedNode} - The resource
*/
function createIfNotExists (doc) {
return new Promise(function (resolve, reject) {
store.fetcher.load(doc).then(
response => {
debug.log('createIfNotExists doc exists, all good ' + doc)
// store.fetcher.webOperation('HEAD', doc.uri).then(response => {
resolve(response)
},
err => {
if (err.response.status === 404) {
debug.log(
'createIfNotExists doc does NOT exist, will create... ' + doc
)

store.fetcher
.webOperation('PUT', doc.uri, {
data: '',
contentType: 'text/turtle'
})
.then(
response => {
// fetcher.requested[doc.uri] = 'done' // do not need to read ?? but no headers
delete store.fetcher.requested[doc.uri] // delete cached 404 error
debug.log('createIfNotExists doc created ok ' + doc)
resolve(response)
},
err => {
debug.log('createIfNotExists doc FAILED: ' + doc + ': ' + err)
reject(err)
}
)
} else {
debug.log(
'createIfNotExists doc load error NOT 404: ' + doc + ': ' + err
)
reject(err)
}
}
)
})
}

// @@@@ use the one in rdflib.js when it is avaiable and delete this
function updatePromise (del, ins) {
return new Promise(function (resolve, reject) {
Expand Down Expand Up @@ -99,7 +51,8 @@ export async function findBookmarkDocument (userContext) {
if (userContext.instances && userContext.instances.length > 0) {
userContext.bookmarkDocument = userContext.instances[0]
if (userContext.instances.length > 1) {
alert('More than one bookmark file! ' + userContext.instances)
debug.warn('More than one bookmark file! ' + userContext.instances) // @@ todo - deal with > 1
// Note: should pick up community bookmarks as well
}
} else {
if (userContext.publicProfile) {
Expand All @@ -109,9 +62,9 @@ export async function findBookmarkDocument (userContext) {
)
try {
debug.log('Creating new bookmark file ' + newBookmarkFile)
await createIfNotExists(newBookmarkFile)
await store.fetcher.createIfNotExists(newBookmarkFile)
} catch (e) {
alert.error("Can't make fresh bookmark file:" + e)
debug.warn("Can't make fresh bookmark file:" + e)
return userContext
}
await registerInTypeIndex(
Expand All @@ -121,7 +74,7 @@ export async function findBookmarkDocument (userContext) {
)
userContext.bookmarkDocument = newBookmarkFile
} else {
alert('You seem to have no bookmark file and not even a profile file.')
debug.warn('You seem to have no bookmark file, nor even a profile file!')
}
}
return userContext
Expand Down Expand Up @@ -164,7 +117,7 @@ async function addBookmark (context, target) {
await updatePromise([], ins) // 20190118A
} catch (e) {
const msg = 'Making bookmark: ' + e
alert.error(msg)
debug.warn(msg)
return null
}
return bookmark
Expand All @@ -188,7 +141,7 @@ export async function toggleBookmark (userContext, target, bookmarkButton) {
debug.log('Bookmark deleted: ' + bookmarks[i])
} catch (e) {
debug.error('Cant delete bookmark:' + e)
alert('Cant delete bookmark:' + e)
debug.warn('Cannot delete bookmark:' + e)
}
}
} else {
Expand Down
Loading
Loading