diff --git a/.husky/css_check.js b/.husky/css_check.js index ee8ae13e96..31bb08895a 100644 --- a/.husky/css_check.js +++ b/.husky/css_check.js @@ -21,7 +21,7 @@ for (const file of files) { content = content.replace(commentPattern, ""); // look for first level selectors const firstLevelSelectors = content.match(firstLevelSelectorPattern) || []; - if (!firstLevelSelectors.every((line) => line.startsWith(".o-spreadsheet "))) { + if (!firstLevelSelectors.every((line) => line.startsWith(".o-spreadsheet ") || line.startsWith(".o-spreadsheet."))) { faultyFiles.push(file); } } @@ -38,7 +38,7 @@ Every css selector should be encompassed within .o-spreadsheet. For example: .o-spreadsheet { ... } -or +or .o-spreadsheet .foo { ... } diff --git a/demo/main.js b/demo/main.js index 4b75fa36fb..d773832f43 100644 --- a/demo/main.js +++ b/demo/main.js @@ -70,7 +70,7 @@ let start; class Demo extends Component { setup() { - this.state = useState({ key: 0, displayHeader: false }); + this.state = useState({ key: 0, displayHeader: false, colorScheme: "light" }); this.stateUpdateMessages = []; this.client = { id: uuidGenerator.uuidv4(), @@ -108,6 +108,15 @@ class Demo extends Component { icon: "o-spreadsheet-Icon.OPEN_DASHBOARD", }); + topbarMenuRegistry.addChild("dark_mode", ["file"], { + name: "Toggle dark mode", + sequence: 12.5, + isReadonlyAllowed: true, + execute: () => + (this.state.colorScheme = this.state.colorScheme === "dark" ? "light" : "dark"), + icon: "o-spreadsheet-Icon.DARK_MODE", + }); + topbarMenuRegistry.addChild("read_write", ["file"], { name: "Open with write access", sequence: 13, @@ -215,7 +224,10 @@ class Demo extends Component { useExternalListener(window, "beforeunload", this.leaveCollaborativeSession.bind(this)); useExternalListener(window, "unhandledrejection", this.notifyError.bind(this)); - useExternalListener(window, "error", this.notifyError.bind(this)); + useExternalListener(window, "error", (ev) => { + console.error("Global error caught: ", ev.error || ev.message); + this.notifyError(); + }); onWillStart(() => this.initiateConnection()); @@ -331,11 +343,11 @@ Demo.template = xml/* xml */ `
=
A1:
A2 @@ -35,31 +35,31 @@ exports[`Composer string is correctly translated to DOM Multi-line formula 1`] =
+ SUM (
5 ) @@ -116,7 +116,7 @@ exports[`Composer string is correctly translated to DOM Selection indicator in m >
= @@ -127,7 +127,7 @@ exports[`Composer string is correctly translated to DOM Selection indicator in m
= @@ -164,32 +164,32 @@ exports[`Composer string is correctly translated to DOM Simple formula 1`] = ` >
= 1 + A1 diff --git a/tests/composer/__snapshots__/formula_assistant_component.test.ts.snap b/tests/composer/__snapshots__/formula_assistant_component.test.ts.snap index d963402f3a..d39c6d54b0 100644 --- a/tests/composer/__snapshots__/formula_assistant_component.test.ts.snap +++ b/tests/composer/__snapshots__/formula_assistant_component.test.ts.snap @@ -5,7 +5,7 @@ exports[`formula assistant appearance simple snapshot with =FUNC1( 1`] = ` class="o-formula-assistant-container user-select-none shadow" >