Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename creator apply theme #6332

Merged
merged 2 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3979,7 +3979,7 @@ export class SurveyCreatorModel extends Base

public preferredColorPalette: string = "light";

public applyTheme(theme: ICreatorTheme): void {
public applyCreatorTheme(theme: ICreatorTheme): void {
this.syncTheme(theme);
const designerPlugin = this.getPlugin("designer") as TabDesignerPlugin;
if (designerPlugin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ test("Creator theme: reset color variables after change theme", (): any => {
}
});

test("creator.applyTheme", () => {
test("creator.applyCreatorTheme", () => {
const creator: CreatorTester = new CreatorTester({ showThemeTab: true, showCreatorThemeSettings: true });
const themeJson: ICreatorTheme = {
themeName: "custom",
Expand All @@ -144,7 +144,7 @@ test("creator.applyTheme", () => {
}
};

creator.applyTheme(themeJson);
creator.applyCreatorTheme(themeJson);

const designerPlugin: TabDesignerPlugin = <TabDesignerPlugin>creator.getPlugin("designer");
const themeModel = designerPlugin["themeModel"];
Expand Down Expand Up @@ -285,7 +285,7 @@ test("Creator theme: apply custom theme", (): any => {
"--sjs-test": "green"
}
};
creator.applyTheme(themeJson);
creator.applyCreatorTheme(themeJson);

const surfaceBackgroundColor = designerPlugin["themePropertyGrid"].survey.findQuestionByName("--sjs-special-background");
const primaryBackgroundColor = designerPlugin["themePropertyGrid"].survey.findQuestionByName("--sjs-primary-background-500");
Expand Down
2 changes: 2 additions & 0 deletions packages/survey-creator-react/testCafe-V2/by-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script src="../node_modules/survey-core/survey.core.js" defer></script>
<script src="../node_modules/survey-core/survey.i18n.js" defer></script>
<script src="../node_modules/survey-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.i18n.js" defer></script>
<script src="../node_modules/survey-react-ui/survey-react-ui.js" defer></script>
Expand All @@ -32,6 +33,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator({ showLogicTab: true, showTranslationTab: true, pageEditMode: "bypage" });
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script src="../node_modules/survey-core/survey.core.js" defer></script>
<script src="../node_modules/survey-core/survey.i18n.js" defer></script>
<script src="../node_modules/survey-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.i18n.js" defer></script>
<script src="../node_modules/survey-react-ui/survey-react-ui.js" defer></script>
Expand All @@ -32,6 +33,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator({ maxVisibleChoices: 5 });
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator();
creator.applyTheme(SurveyCreatorTheme.DefaultLight);
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script src="../node_modules/survey-core/survey.core.js" defer></script>
<script src="../node_modules/survey-core/survey.i18n.js" defer></script>
<script src="../node_modules/survey-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.i18n.js" defer></script>
<script src="../node_modules/survey-react-ui/survey-react-ui.js" defer></script>
Expand All @@ -31,6 +32,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator({ showLogicTab: true, showTranslationTab: true });
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator({ showThemeTab: true });
creator.applyTheme(SurveyCreatorTheme.DefaultLight);
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
4 changes: 2 additions & 2 deletions packages/survey-creator-react/testCafe-V2/testcafe.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator({ showLogicTab: true, showTranslationTab: true });
creator.applyTheme(SurveyCreatorTheme.DefaultLight);
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;

class SurveyCreatorRenderComponent extends React.Component {
Expand All @@ -43,7 +43,7 @@
window.updateCreatorModel = (options, json) => {
window.prevCreator = window.creator;
const creator = new SurveyCreator.SurveyCreator(options);
creator.applyTheme(SurveyCreatorTheme.DefaultLight);
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
creator.JSON = json;
this.setState({ creator });
window.creator = creator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script src="../node_modules/survey-core/survey.core.js" defer></script>
<script src="../node_modules/survey-core/survey.i18n.js" defer></script>
<script src="../node_modules/survey-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.i18n.js" defer></script>
<script src="../node_modules/survey-react-ui/survey-react-ui.js" defer></script>
Expand All @@ -35,6 +36,7 @@
loc.ed.logic = "Miner Logik";
SurveyCreatorCore.localization.currentLocale = "de";
const creator = new SurveyCreator.SurveyCreator({ showLogicTab: true, showTranslationTab: true });
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script src="../node_modules/survey-core/survey.core.js" defer></script>
<script src="../node_modules/survey-core/survey.i18n.js" defer></script>
<script src="../node_modules/survey-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/themes/index.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.js" defer></script>
<script src="../node_modules/survey-creator-core/survey-creator-core.i18n.js" defer></script>
<script src="../node_modules/survey-react-ui/survey-react-ui.js" defer></script>
Expand All @@ -32,6 +33,7 @@
window.addEventListener("DOMContentLoaded", () => {
window.surveyJSFramework = "react";
const creator = new SurveyCreator.SurveyCreator({ themeForPreview: "modern" });
creator.applyCreatorTheme(SurveyCreatorTheme.DefaultLight);
window.creator = creator;
const root = ReactDOMClient.createRoot(document.getElementById("survey-creator"));
root.render(React.createElement(React.StrictMode, {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading