Compare commits

8 Commits

Author SHA1 Message Date
dafa4242dd chore: github build cache 2024-05-30 11:18:48 +08:00
b36274db37 chore: build docker image by github actions 2024-05-30 11:18:48 +08:00
dc0550b112 feat: right-click to open menu for document/collection links 2024-05-30 11:18:48 +08:00
Tom Moor
1ceb87515d fix: Default feature flag logic 2024-05-29 21:30:42 -04:00
Tom Moor
1c4817486b Bump paragraph spacing 2024-05-29 21:29:10 -04:00
Tom Moor
4b1b87abde fix: Cannot remove user from collection in beta sharing UI 2024-05-29 20:04:20 -04:00
Tom Moor
5e841f6b16 fix: Correctly replace urls with signed versions when fully qualified 2024-05-29 19:55:54 -04:00
dependabot[bot]
6fd7e755b0 chore(deps): bump semver and @types/semver (#6954)
Bumps [semver](https://github.com/npm/node-semver) and [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver). These dependencies needed to be updated together.

Updates `semver` from 7.6.0 to 7.6.2
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.6.0...v7.6.2)

Updates `@types/semver` from 7.5.6 to 7.5.8
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: "@types/semver"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 15:50:33 -07:00
8 changed files with 53 additions and 70 deletions

View File

@@ -146,18 +146,20 @@ function CollectionMemberList({ collection, invitedInSession }: Props) {
<InputMemberPermissionSelect
style={{ margin: 0 }}
permissions={permissions}
onChange={async (permission: CollectionPermission) => {
if (permission) {
onChange={async (
permission: CollectionPermission | typeof EmptySelectValue
) => {
if (permission === EmptySelectValue) {
await memberships.delete({
collectionId: collection.id,
userId: membership.userId,
});
} else {
await memberships.create({
collectionId: collection.id,
userId: membership.userId,
permission,
});
} else {
await memberships.delete({
collectionId: collection.id,
userId: membership.userId,
});
}
}}
disabled={!can.update}

View File

@@ -28,7 +28,7 @@ export class FeatureFlags {
this.initalized = true;
}
return this.cache.has(flag) ?? FeatureDefaults[flag];
return this.cache.has(flag) ? true : FeatureDefaults[flag] ?? false;
}
public static enable(flag: Feature) {

View File

@@ -210,7 +210,7 @@
"resolve-path": "^1.4.0",
"rfc6902": "^5.1.1",
"sanitize-filename": "^1.6.3",
"semver": "^7.5.2",
"semver": "^7.6.2",
"sequelize": "^6.37.3",
"sequelize-cli": "^6.6.1",
"sequelize-encrypted": "^1.0.0",
@@ -304,7 +304,7 @@
"@types/redis-info": "^3.0.3",
"@types/refractor": "^3.4.0",
"@types/resolve-path": "^1.4.2",
"@types/semver": "^7.5.6",
"@types/semver": "^7.5.8",
"@types/sequelize": "^4.28.19",
"@types/slug": "^5.0.7",
"@types/stoppable": "^1.1.3",
@@ -346,7 +346,6 @@
"prettier": "^2.8.8",
"react-refresh": "^0.14.0",
"rimraf": "^2.5.4",
"rollup-plugin-visualizer": "^5.12.0",
"rollup-plugin-webpack-stats": "^0.2.4",
"terser": "^5.19.2",
"typescript": "^5.4.5",

View File

@@ -203,16 +203,32 @@ export class ProsemirrorHelper {
const json = doc.toJSON() as ProsemirrorData;
function getMapping(href: string) {
let relativeHref;
try {
const url = new URL(href);
relativeHref = url.toString().substring(url.origin.length);
} catch {
// Noop: Invalid url.
}
return (
mapping[href] ||
(relativeHref ? mapping[relativeHref] : undefined) ||
href
);
}
function replaceAttachmentUrls(node: ProsemirrorData) {
if (node.attrs?.src) {
node.attrs.src = mapping[node.attrs.src as string] || node.attrs.src;
node.attrs.src = getMapping(String(node.attrs.src));
} else if (node.attrs?.href) {
node.attrs.href = mapping[node.attrs.href as string] || node.attrs.href;
node.attrs.href = getMapping(String(node.attrs.href));
} else if (node.marks) {
node.marks.forEach((mark) => {
if (mark.attrs?.href) {
mark.attrs.href =
mapping[mark.attrs.href as string] || mark.attrs.href;
mark.attrs.href = getMapping(String(mark.attrs.href));
}
});
}

View File

@@ -320,8 +320,8 @@ width: 100%;
}
& > * {
margin-top: .5em;
margin-bottom: .5em;
margin-top: 0.85em;
margin-bottom: 0.85em;
&:last-child {
margin-bottom: 0;
@@ -497,8 +497,8 @@ iframe.embed {
max-width: 840px;
cursor: default;
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-top: 0.85em;
margin-bottom: 0.85em;
.title,
.subtitle {
@@ -1244,7 +1244,7 @@ pre {
background: ${props.theme.codeBackground};
border-radius: 4px;
border: 1px solid ${props.theme.codeBorder};
margin: .5em 0;
margin: 0.85em 0;
-webkit-font-smoothing: initial;
font-family: ${props.theme.fontFamilyMono};

View File

@@ -80,7 +80,7 @@ export default createGlobalStyle<Props>`
font-weight: 500;
line-height: 1.25;
margin-top: 1em;
margin-bottom: 0.5em;
margin-bottom: 0.85em;
}
h1 { font-size: 36px; }
h2 { font-size: 26px; }

View File

@@ -2,7 +2,6 @@ import fs from "fs";
import path from "path";
import react from "@vitejs/plugin-react";
import browserslistToEsbuild from "browserslist-to-esbuild";
import { visualizer } from "rollup-plugin-visualizer";
import { webpackStats } from "rollup-plugin-webpack-stats";
import { CommonServerOptions, defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
@@ -141,13 +140,6 @@ export default () =>
}),
// Generate a stats.json file for webpack that will be consumed by RelativeCI
webpackStats(),
visualizer({
template: "treemap", // or sunburst
// open: true,
gzipSize: true,
brotliSize: true,
filename: "analyse.html", // will be saved in project's root
}),
],
optimizeDeps: {
esbuildOptions: {
@@ -181,10 +173,10 @@ export default () =>
index: "./app/index.tsx",
},
output: {
assetFileNames: "assets/[name].[hash][extname]",
chunkFileNames: "assets/[name].[hash].js",
entryFileNames: "assets/[name].[hash].js",
},
assetFileNames: 'assets/[name].[hash][extname]',
chunkFileNames: 'assets/[name].[hash].js',
entryFileNames: 'assets/[name].[hash].js',
}
},
},
});

View File

@@ -4883,10 +4883,10 @@
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
integrity "sha1-GmL4lSVyPd4kuhsBsJK/XfitTTk= sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew=="
"@types/semver@^7.5.0", "@types/semver@^7.5.6":
version "7.5.6"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339"
integrity "sha1-xlsr/OG+w0ZYLAdyTj+MEBeiAzk= sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A=="
"@types/semver@^7.5.0", "@types/semver@^7.5.8":
version "7.5.8"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==
"@types/sequelize@^4.28.19":
version "4.28.19"
@@ -7208,11 +7208,6 @@ define-data-property@^1.0.1, define-data-property@^1.1.4:
es-errors "^1.3.0"
gopd "^1.0.1"
define-lazy-prop@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c"
@@ -9454,7 +9449,7 @@ is-decimal@^1.0.0:
resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5"
integrity "sha1-ZaOllYocW2OnBuGzM9fNn2MNP6U= sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw=="
is-docker@^2.0.0, is-docker@^2.1.1:
is-docker@^2.0.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
integrity "sha1-M+6r4jz+hvFL3kQIoCwM+4U6zao= sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="
@@ -9697,7 +9692,7 @@ is-windows@^1.0.1:
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
integrity "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0= sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA=="
is-wsl@^2.1.1, is-wsl@^2.2.0:
is-wsl@^2.1.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
integrity "sha1-dKTHbnfKn9P5MvKQwX6jJs0VcnE= sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="
@@ -11739,15 +11734,6 @@ open@^7.4.2:
is-docker "^2.0.0"
is-wsl "^2.1.1"
open@^8.4.0:
version "8.4.2"
resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9"
integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==
dependencies:
define-lazy-prop "^2.0.0"
is-docker "^2.1.1"
is-wsl "^2.2.0"
opentracing@>=0.12.1:
version "0.14.5"
resolved "https://registry.yarnpkg.com/opentracing/-/opentracing-0.14.5.tgz#891fa92cd90a24e64f99bc964370227310926c85"
@@ -13277,16 +13263,6 @@ rollup-plugin-terser@^7.0.0:
serialize-javascript "^4.0.0"
terser "^5.0.0"
rollup-plugin-visualizer@^5.12.0:
version "5.12.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.12.0.tgz#661542191ce78ee4f378995297260d0c1efb1302"
integrity sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==
dependencies:
open "^8.4.0"
picomatch "^2.3.1"
source-map "^0.7.4"
yargs "^17.5.1"
rollup-plugin-webpack-stats@^0.2.4:
version "0.2.4"
resolved "https://registry.yarnpkg.com/rollup-plugin-webpack-stats/-/rollup-plugin-webpack-stats-0.2.4.tgz#79e8cdcbd8be87310506fb9f86e49fb16de06962"
@@ -13440,12 +13416,10 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semve
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
semver@^7.5.0, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4:
version "7.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d"
integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==
dependencies:
lru-cache "^6.0.0"
semver@^7.5.0, semver@^7.5.2, semver@^7.5.3, semver@^7.5.4, semver@^7.6.2:
version "7.6.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==
semver@~7.0.0:
version "7.0.0"
@@ -15392,7 +15366,7 @@ yargs-parser@^21.1.1:
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity "sha1-kJa87r+ZDSG7MfqVFuDt4pSnfTU= sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="
yargs@17.7.2, yargs@^17.3.1, yargs@^17.5.1, yargs@^17.7.2:
yargs@17.7.2, yargs@^17.3.1, yargs@^17.7.2:
version "17.7.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
integrity "sha1-mR3zmspnWhkrgW4eA2P5110qomk= sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="