feat: add support for tldraw snapshot links (#6210)
This commit is contained in:
@@ -9,9 +9,26 @@ describe("Tldraw", () => {
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test("to be enabled for snapshot link", () => {
|
||||
expect(
|
||||
"https://beta.tldraw.com/s/v2_c_r5WVtGaktE99D3wyFFsoL".match(match)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test("to be enabled for read only urls having v", () => {
|
||||
expect(
|
||||
"https://www.tldraw.com/v/-2VIEZVwrbtdNq0Pmfpf2?viewport=-608%2C-549%2C1998%2C1943&page=page%3AWd7DfjA-igxOMso931W_S".match(
|
||||
match
|
||||
)
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test("to not be enabled elsewhere", () => {
|
||||
expect("https://wwww.tldraw.com/r/c9d837d74182317".match(match)).toBe(null);
|
||||
expect("https://wwwwtldraw.com/r/c9d837d74182317".match(match)).toBe(null);
|
||||
expect("https://www.tldrawwcom/r/c9d837d74182317".match(match)).toBe(null);
|
||||
expect(
|
||||
"https://beta.tldraw.com/e/v2_c_r5WVtGaktE99D3wyFFsoL".match(match)
|
||||
).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,6 +14,8 @@ function Tldraw(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
Tldraw.ENABLED = [new RegExp("^https?://(beta|www|old)\\.tldraw\\.com/r/(.*)")];
|
||||
Tldraw.ENABLED = [
|
||||
new RegExp("^https?://(beta|www|old)\\.tldraw\\.com/[rsv]/(.*)"),
|
||||
];
|
||||
|
||||
export default Tldraw;
|
||||
|
||||
Reference in New Issue
Block a user