Skip to content

Commit

Permalink
update lit-element to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Jan 9, 2025
1 parent 7ff17f9 commit 5fc01d5
Show file tree
Hide file tree
Showing 39 changed files with 194 additions and 107 deletions.
2 changes: 1 addition & 1 deletion source/server/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("Web Server Integration", function(){
let r = await this.agent.post("/scenes/bar")
.set("Content-Type", "application/octet-stream")
.send(content)
.expect(201);
expect(r.status, `Expected status code 201 but received [${r.status}]: ${r.text}`).to.equal(201);
let res = await this.agent.get("/scenes/bar/models/bar.glb").expect(200);
expect(res.text.slice(0,4).toString()).to.equal("glTF");
expect(res.text.length).to.equal(content.length);
Expand Down
6 changes: 3 additions & 3 deletions source/ui/MainView.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LitElement, html, customElement } from 'lit-element';
import { LitElement, html } from 'lit';
import { customElement } from 'lit/decorators.js';


import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!./styles/main.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!./styles/main.scss';

import "./styles/globals.scss";

Expand Down
4 changes: 2 additions & 2 deletions source/ui/composants/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import "./Icon";

import { customElement, property, html, PropertyValues, LitElement } from "lit-element";

import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

////////////////////////////////////////////////////////////////////////////////

Expand Down
7 changes: 4 additions & 3 deletions source/ui/composants/HistoryAggregation.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { css, customElement, html, LitElement, property, PropertyValues, state, TemplateResult } from "lit-element";
import { LitElement, PropertyValues, TemplateResult, css, html } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';

import Notification from "../composants/Notification";
import i18n from "../state/translate";

import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!../styles/common.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!../styles/common.scss';
import HttpError from "../state/HttpError";


Expand Down Expand Up @@ -115,7 +116,7 @@ export class HistoryEntryAggregate extends i18n(LitElement){
super.connectedCallback();
}

protected createRenderRoot(): Element | ShadowRoot {
protected createRenderRoot() {
return this;
}

Expand Down
3 changes: 2 additions & 1 deletion source/ui/composants/Icon.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {LitElement, customElement, property, html, TemplateResult} from "lit-element";
import { LitElement, TemplateResult, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

/**
* Imported from
Expand Down
4 changes: 3 additions & 1 deletion source/ui/composants/ListItem.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { css, customElement, html, LitElement, property } from "lit-element";
import { LitElement, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';




Expand Down
5 changes: 3 additions & 2 deletions source/ui/composants/Modal.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { LitElement, TemplateResult, css, html } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';

import { css, LitElement,customElement, property, html, TemplateResult, query } from "lit-element";
import "./Icon"


import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!../styles/common.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!../styles/common.scss';

interface ModalOptions{
header :TemplateResult|string;
Expand Down
6 changes: 4 additions & 2 deletions source/ui/composants/Notification.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { LitElement, css, customElement, html, property } from "lit-element";
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';


import "./Icon";

import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!../styles/notifications.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!../styles/notifications.scss';


type NotificationLevel = "info" | "success" | "warning" | "error";
Expand Down
4 changes: 3 additions & 1 deletion source/ui/composants/SceneCard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { LitElement, customElement, property, html, TemplateResult, css } from "lit-element";
import { LitElement, TemplateResult, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';


import defaultSprite from "../assets/images/defaultSprite.svg";

Expand Down
3 changes: 2 additions & 1 deletion source/ui/composants/Size.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LitElement, property, customElement, html } from "lit-element";
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';



Expand Down
3 changes: 2 additions & 1 deletion source/ui/composants/Spinner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LitElement, property, customElement, html, css } from "lit-element";
import { LitElement, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';


@customElement("spin-loader")
Expand Down
4 changes: 3 additions & 1 deletion source/ui/composants/TagList.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { LitElement, css, customElement, html, property } from "lit-element";
import { LitElement, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

import { navigate } from "../state/router";


Expand Down
3 changes: 2 additions & 1 deletion source/ui/composants/TaskButton.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LitElement, TemplateResult, css, html } from 'lit';
import { customElement } from 'lit/decorators.js';

import { css, LitElement,customElement, property, html, TemplateResult } from "lit-element";



Expand Down
3 changes: 2 additions & 1 deletion source/ui/composants/UploadButton.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LitElement, TemplateResult, css, html } from 'lit';
import { customElement } from 'lit/decorators.js';

import { css, LitElement, customElement, html, TemplateResult } from "lit-element";


@customElement("upload-button")
Expand Down
5 changes: 3 additions & 2 deletions source/ui/composants/UserLogin.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { LitElement, TemplateResult, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

import { css, LitElement,customElement, property, html, TemplateResult } from "lit-element";


import { doLogin } from "../state/auth";
import i18n from "../state/translate";

import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!../styles/common.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!../styles/common.scss';
import Notification from "./Notification";

/**
Expand Down
6 changes: 4 additions & 2 deletions source/ui/composants/navbar/ChangeLocale.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { LitElement, html, customElement, property, css, TemplateResult } from 'lit-element';
import { LitElement, TemplateResult, html } from 'lit';
import { customElement } from 'lit/decorators.js';


import i18n, {Localization} from '../../state/translate';

Expand All @@ -13,7 +15,7 @@ export default class ChangeLocale extends i18n(LitElement){

return false;
}
protected createRenderRoot(): Element | ShadowRoot {
protected createRenderRoot(){
return this;
}

Expand Down
6 changes: 4 additions & 2 deletions source/ui/composants/navbar/NavLink.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { LitElement, html, customElement, property, css } from 'lit-element';
import { LitElement, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';


import { link, navigate } from '../../state/router';

import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!./styles.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!./styles.scss';

@customElement("nav-link")
export default class NavLink extends LitElement{
Expand Down
5 changes: 3 additions & 2 deletions source/ui/composants/navbar/Navbar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LitElement, TemplateResult, html } from 'lit';
import { customElement } from 'lit/decorators.js';

import { css, customElement, html, LitElement, TemplateResult } from "lit-element";

import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!./styles.scss';
import styles from '!lit-css-loader?{"specifier":"lit"}!sass-loader!./styles.scss';

import logo from "../../assets/images/logo-full.svg";

Expand Down
3 changes: 2 additions & 1 deletion source/ui/composants/navbar/UserButton.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LitElement, PropertyValues, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';

import { customElement, property, html, PropertyValues, css } from "lit-element";

import "../Modal";
import Modal from "../Modal";
Expand Down
8 changes: 4 additions & 4 deletions source/ui/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ declare module '!raw-loader!*' {
}

declare module '!lit-css-loader*.scss' {
import {CSSResult} from 'lit-element';
import {CSSResult} from 'lit';
const css: CSSResult;
export default css;
}
declare module '!lit-css-loader*.css' {
import {CSSResult} from 'lit-element';
import {CSSResult} from 'lit';
const css: CSSResult;
export default css;
}

declare module "*.scss" {
import {CSSResult} from 'lit-element';
import {CSSResult} from 'lit';
const css: CSSResult;
export default css.cssText;
}
declare module "*.css"{
import {CSSResult} from 'lit-element';
import {CSSResult} from 'lit';
const css: CSSResult;
export default css.cssText;
}
Expand Down
Loading

0 comments on commit 5fc01d5

Please sign in to comment.