Compare commits

...

21 Commits

Author SHA1 Message Date
Ajay Bura
91a6916f4c Release v2.2.2 2022-09-28 20:48:41 +05:30
renovate[bot]
78374d0301 Update dependency matrix-js-sdk to v20 (#879)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-28 20:43:56 +05:30
Krishan
9185ee0cf9 Release v2.2.1 2022-09-28 19:26:12 +05:30
renovate[bot]
e2de51832c Update dependency matrix-js-sdk to v19.7.0 (#876)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-28 19:16:07 +05:30
Ajay Bura
759f16d5b9 Fix crash on space leave 2022-09-28 18:17:15 +05:30
Ajay Bura
d0ddedc2b2 Wrap view source text 2022-09-28 13:54:58 +05:30
ginnyTheCat
4291005161 Handle nested lists (#853)
* Handle nested lists

* Allow heading to not be followed by an empty line

* Don't parse as inline code if contains newlines

* Use escape rule in plain as well
2022-09-25 19:31:59 +05:30
renovate[bot]
ee144ccb2b Lock file maintenance (#873)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 12:45:50 +05:30
renovate[bot]
7fea21f221 Update dependency sass to v1.55.0 (#872)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 12:43:13 +05:30
renovate[bot]
9a4b40f242 Update dependency html-loader to v4.2.0 (#871)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 12:40:16 +05:30
renovate[bot]
c2d353b973 Update dependency eslint to v8.24.0 (#870)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 12:37:41 +05:30
renovate[bot]
8b6cecdbf8 Update dependency webpack-dev-server to v4.11.1 (#869)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 12:35:29 +05:30
renovate[bot]
83d8f2821a Update dependency @khanacademy/simple-markdown to v0.8.4 (#868)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 12:33:28 +05:30
Krishan
0225204b4d Require approval before opening dep update PR (#865) 2022-09-19 20:32:40 +05:30
renovate[bot]
478957803d Lock file maintenance (#858)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 10:07:01 +05:30
renovate[bot]
0181cb26d2 Update dependency linkifyjs to v4.0.0 (#861)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 10:03:45 +05:30
renovate[bot]
2ddb3595c7 Update dependency sanitize-html to v2.7.2 (#862)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 10:02:57 +05:30
renovate[bot]
76e49d1bd0 Update dependency linkify-html to v4.0.0 (#860)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 10:02:15 +05:30
renovate[bot]
91f1ee748e Update babel monorepo to v7.19.1 (#859)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 09:13:58 +05:30
renovate[bot]
9bddf64510 Lock file maintenance (#857)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 08:58:19 +05:30
Ajay Bura
2200ae143e Update sdk doc link so that it's not fixed to one version 2022-09-18 20:18:23 +05:30
8 changed files with 378 additions and 288 deletions

View File

@@ -1,7 +1,8 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ "extends": [
"config:base" "config:base",
":dependencyDashboardApproval"
], ],
"labels": [ "Dependencies" ], "labels": [ "Dependencies" ],
"packageRules": [ "packageRules": [
@@ -10,6 +11,5 @@
} }
], ],
"lockFileMaintenance": { "enabled": true }, "lockFileMaintenance": { "enabled": true },
"dependencyDashboard": true, "dependencyDashboard": true
"dependencyDashboardApproval": true
} }

View File

@@ -41,4 +41,4 @@ Also, we use [ESLint](https://eslint.org/) for clean and stylistically consisten
## Helpful links ## Helpful links
- [BEM methodology](http://getbem.com/introduction/) - [BEM methodology](http://getbem.com/introduction/)
- [Atomic design](https://bradfrost.com/blog/post/atomic-web-design/) - [Atomic design](https://bradfrost.com/blog/post/atomic-web-design/)
- [Matrix JavaScript SDK documentation](https://matrix-org.github.io/matrix-js-sdk/19.2.0/index.html) - [Matrix JavaScript SDK documentation](https://matrix-org.github.io/matrix-js-sdk/index.html)

590
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "cinny", "name": "cinny",
"version": "2.2.0", "version": "2.2.2",
"description": "Yet another matrix client", "description": "Yet another matrix client",
"main": "index.js", "main": "index.js",
"engines": { "engines": {
@@ -17,7 +17,7 @@
"dependencies": { "dependencies": {
"@fontsource/inter": "4.5.12", "@fontsource/inter": "4.5.12",
"@fontsource/roboto": "4.5.8", "@fontsource/roboto": "4.5.8",
"@khanacademy/simple-markdown": "0.8.3", "@khanacademy/simple-markdown": "0.8.4",
"@matrix-org/olm": "3.2.12", "@matrix-org/olm": "3.2.12",
"@tippyjs/react": "4.2.6", "@tippyjs/react": "4.2.6",
"babel-polyfill": "6.26.0", "babel-polyfill": "6.26.0",
@@ -30,9 +30,9 @@
"formik": "2.2.9", "formik": "2.2.9",
"html-react-parser": "3.0.4", "html-react-parser": "3.0.4",
"katex": "0.16.2", "katex": "0.16.2",
"linkify-html": "4.0.0-beta.5", "linkify-html": "4.0.0",
"linkifyjs": "4.0.0-beta.5", "linkifyjs": "4.0.0",
"matrix-js-sdk": "19.5.0", "matrix-js-sdk": "20.0.0",
"prop-types": "15.8.1", "prop-types": "15.8.1",
"react": "17.0.2", "react": "17.0.2",
"react-autosize-textarea": "7.1.0", "react-autosize-textarea": "7.1.0",
@@ -42,13 +42,13 @@
"react-dom": "17.0.2", "react-dom": "17.0.2",
"react-google-recaptcha": "2.1.0", "react-google-recaptcha": "2.1.0",
"react-modal": "3.15.1", "react-modal": "3.15.1",
"sanitize-html": "2.7.1", "sanitize-html": "2.7.2",
"tippy.js": "6.3.7", "tippy.js": "6.3.7",
"twemoji": "14.0.2" "twemoji": "14.0.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.19.0", "@babel/core": "7.19.1",
"@babel/preset-env": "7.19.0", "@babel/preset-env": "7.19.1",
"@babel/preset-react": "7.18.6", "@babel/preset-react": "7.18.6",
"assert": "2.0.0", "assert": "2.0.0",
"babel-loader": "8.2.5", "babel-loader": "8.2.5",
@@ -59,17 +59,17 @@
"crypto-browserify": "3.12.0", "crypto-browserify": "3.12.0",
"css-loader": "6.7.1", "css-loader": "6.7.1",
"css-minimizer-webpack-plugin": "4.1.0", "css-minimizer-webpack-plugin": "4.1.0",
"eslint": "8.23.1", "eslint": "8.24.0",
"eslint-config-airbnb": "19.0.4", "eslint-config-airbnb": "19.0.4",
"eslint-plugin-import": "2.26.0", "eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx-a11y": "6.6.1", "eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-react": "7.31.8", "eslint-plugin-react": "7.31.8",
"eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-react-hooks": "4.6.0",
"html-loader": "4.1.0", "html-loader": "4.2.0",
"html-webpack-plugin": "5.5.0", "html-webpack-plugin": "5.5.0",
"mini-css-extract-plugin": "2.6.1", "mini-css-extract-plugin": "2.6.1",
"path-browserify": "1.0.1", "path-browserify": "1.0.1",
"sass": "1.54.9", "sass": "1.55.0",
"sass-loader": "13.0.2", "sass-loader": "13.0.2",
"stream-browserify": "3.0.0", "stream-browserify": "3.0.0",
"style-loader": "3.3.1", "style-loader": "3.3.1",
@@ -77,7 +77,7 @@
"util": "0.12.4", "util": "0.12.4",
"webpack": "5.74.0", "webpack": "5.74.0",
"webpack-cli": "4.10.0", "webpack-cli": "4.10.0",
"webpack-dev-server": "4.11.0", "webpack-dev-server": "4.11.1",
"webpack-merge": "5.8.0" "webpack-merge": "5.8.0"
} }
} }

View File

@@ -25,7 +25,7 @@ function Home({ spaceId }) {
let directIds = []; let directIds = [];
if (spaceId) { if (spaceId) {
const spaceChildIds = roomList.getSpaceChildren(spaceId); const spaceChildIds = roomList.getSpaceChildren(spaceId) ?? [];
spaceIds = spaceChildIds.filter((roomId) => spaces.has(roomId)); spaceIds = spaceChildIds.filter((roomId) => spaces.has(roomId));
roomIds = spaceChildIds.filter((roomId) => rooms.has(roomId)); roomIds = spaceChildIds.filter((roomId) => rooms.has(roomId));
directIds = spaceChildIds.filter((roomId) => directs.has(roomId)); directIds = spaceChildIds.filter((roomId) => directs.has(roomId));

View File

@@ -5,6 +5,8 @@
& pre { & pre {
padding: var(--sp-extra-tight); padding: var(--sp-extra-tight);
white-space: pre-wrap;
word-break: break-all;
} }
&__card { &__card {

View File

@@ -1,5 +1,5 @@
const cons = { const cons = {
version: '2.2.0', version: '2.2.2',
secretKey: { secretKey: {
ACCESS_TOKEN: 'cinny_access_token', ACCESS_TOKEN: 'cinny_access_token',
DEVICE_ID: 'cinny_device_id', DEVICE_ID: 'cinny_device_id',

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-param-reassign */
/* eslint-disable no-use-before-define */ /* eslint-disable no-use-before-define */
import SimpleMarkdown from '@khanacademy/simple-markdown'; import SimpleMarkdown from '@khanacademy/simple-markdown';
import { idRegex, parseIdUri } from './common'; import { idRegex, parseIdUri } from './common';
@@ -88,6 +89,10 @@ const plainRules = {
plain: (node, output, state) => `${output(node.content, state)}\n\n`, plain: (node, output, state) => `${output(node.content, state)}\n\n`,
html: (node, output, state) => htmlTag('p', output(node.content, state)), html: (node, output, state) => htmlTag('p', output(node.content, state)),
}, },
escape: {
...defaultRules.escape,
plain: (node, output, state) => `\\${output(node.content, state)}`,
},
br: { br: {
...defaultRules.br, ...defaultRules.br,
match: anyScopeRegex(/^ *\n/), match: anyScopeRegex(/^ *\n/),
@@ -107,7 +112,7 @@ const markdownRules = {
...plainRules, ...plainRules,
heading: { heading: {
...defaultRules.heading, ...defaultRules.heading,
match: blockRegex(/^ *(#{1,6})([^\n:]*?(?: [^\n]*?)?)#* *(?:\n *)+\n/), match: blockRegex(/^ *(#{1,6})([^\n:]*?(?: [^\n]*?)?)#* *(?:\n *)*\n/),
plain: (node, output, state) => { plain: (node, output, state) => {
const out = output(node.content, state); const out = output(node.content, state);
if (state.kind === 'edit' || state.kind === 'notification' || node.level > 2) { if (state.kind === 'edit' || state.kind === 'notification' || node.level > 2) {
@@ -122,7 +127,7 @@ const markdownRules = {
}, },
codeBlock: { codeBlock: {
...defaultRules.codeBlock, ...defaultRules.codeBlock,
plain: (node) => `\`\`\`${node.lang || ''}\n${node.content}\n\`\`\``, plain: (node) => `\`\`\`${node.lang || ''}\n${node.content}\n\`\`\`\n`,
html: (node) => htmlTag('pre', htmlTag('code', sanitizeText(node.content), { html: (node) => htmlTag('pre', htmlTag('code', sanitizeText(node.content), {
class: node.lang ? `language-${node.lang}` : undefined, class: node.lang ? `language-${node.lang}` : undefined,
})), })),
@@ -137,10 +142,22 @@ const markdownRules = {
}, },
list: { list: {
...defaultRules.list, ...defaultRules.list,
plain: (node, output, state) => `${node.items.map((item, i) => { plain: (node, output, state) => {
const prefix = node.ordered ? `${node.start + i}. ` : '* '; const oldList = state._list;
return prefix + output(item, state).replace(/\n/g, `\n${' '.repeat(prefix.length)}`); state._list = true;
}).join('\n')}\n`,
let items = node.items.map((item, i) => {
const prefix = node.ordered ? `${node.start + i}. ` : '* ';
return prefix + output(item, state).replace(/\n/g, `\n${' '.repeat(prefix.length)}`);
}).join('\n');
state._list = oldList;
if (!state._list) {
items += '\n\n';
}
return items;
},
}, },
def: undefined, def: undefined,
table: { table: {
@@ -219,10 +236,6 @@ const markdownRules = {
match: inlineRegex(/^¯\\_\(ツ\)_\/¯/), match: inlineRegex(/^¯\\_\(ツ\)_\/¯/),
parse: (capture) => ({ type: 'text', content: capture[0] }), parse: (capture) => ({ type: 'text', content: capture[0] }),
}, },
escape: {
...defaultRules.escape,
plain: (node, output, state) => `\\${output(node.content, state)}`,
},
tableSeparator: { tableSeparator: {
...defaultRules.tableSeparator, ...defaultRules.tableSeparator,
plain: () => ' | ', plain: () => ' | ',
@@ -278,6 +291,7 @@ const markdownRules = {
}, },
inlineCode: { inlineCode: {
...defaultRules.inlineCode, ...defaultRules.inlineCode,
match: inlineRegex(/^(`+)([^\n]*?[^`\n])\1(?!`)/),
plain: (node) => `\`${node.content}\``, plain: (node) => `\`${node.content}\``,
}, },
spoiler: { spoiler: {
@@ -349,13 +363,13 @@ function mapElement(el) {
case 'BLOCKQUOTE': case 'BLOCKQUOTE':
return [{ type: 'blockQuote', content: mapChildren(el) }]; return [{ type: 'blockQuote', content: mapChildren(el) }];
case 'UL': case 'UL':
return [{ type: 'list', items: mapChildren(el) }]; return [{ type: 'list', items: Array.from(el.childNodes).map(mapNode) }];
case 'OL': case 'OL':
return [{ return [{
type: 'list', type: 'list',
ordered: true, ordered: true,
start: Number(el.getAttribute('start')), start: Number(el.getAttribute('start')),
items: mapChildren(el), items: Array.from(el.childNodes).map(mapNode),
}]; }];
case 'TABLE': { case 'TABLE': {
const headerEl = Array.from(el.querySelector('thead > tr').childNodes); const headerEl = Array.from(el.querySelector('thead > tr').childNodes);