mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge pull request #3051 from mermaid-js/3050_setTitle_rename
#3050 Renaming setTitle to setAccTitle
This commit is contained in:
commit
0fd11562bc
@ -15,9 +15,9 @@
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:jsdoc/recommended",
|
||||
//"plugin:jsdoc/recommended",
|
||||
"plugin:json/recommended",
|
||||
"plugin:markdown/recommended",
|
||||
// "plugin:markdown/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"plugins": ["html", "jest", "jsdoc", "json", "prettier"],
|
||||
|
@ -9,7 +9,7 @@ export const clear = function () {
|
||||
description = '';
|
||||
};
|
||||
|
||||
export const setTitle = function (txt) {
|
||||
export const setAccTitle = function (txt) {
|
||||
title = sanitizeText(txt).replace(/^\s+/g, '');
|
||||
};
|
||||
|
||||
@ -26,7 +26,7 @@ export const getAccDescription = function () {
|
||||
};
|
||||
|
||||
export default {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
|
@ -5,7 +5,7 @@ import common from '../common/common';
|
||||
import utils from '../../utils';
|
||||
import mermaidAPI from '../../mermaidAPI';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -355,7 +355,7 @@ const setDirection = (dir) => {
|
||||
|
||||
export default {
|
||||
parseDirective,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
|
@ -263,7 +263,7 @@ statement
|
||||
| cssClassStatement
|
||||
| directive
|
||||
| direction
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
|
||||
;
|
||||
|
@ -3,7 +3,7 @@ import mermaidAPI from '../../mermaidAPI';
|
||||
import * as configApi from '../../config';
|
||||
import common from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -93,7 +93,7 @@ export default {
|
||||
addRelationship,
|
||||
getRelationships,
|
||||
clear,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
setAccDescription,
|
||||
getAccDescription,
|
||||
|
@ -94,8 +94,8 @@ statement
|
||||
}
|
||||
| entityName BLOCK_START BLOCK_STOP { yy.addEntity($1); }
|
||||
| entityName { yy.addEntity($1); }
|
||||
| title title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| title title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
|
||||
;
|
||||
|
@ -5,7 +5,7 @@ import common from '../common/common';
|
||||
import mermaidAPI from '../../mermaidAPI';
|
||||
import { log } from '../../logger';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -746,7 +746,7 @@ const makeUniq = (sg, allSubgraphs) => {
|
||||
export default {
|
||||
parseDirective,
|
||||
defaultConfig: () => configApi.defaultConfig.flowchart,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
|
@ -348,7 +348,7 @@ statement
|
||||
| subgraph separator document end
|
||||
{$$=yy.addSubGraph(undefined,$3,undefined);}
|
||||
| direction
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
|
||||
;
|
||||
|
@ -6,7 +6,7 @@ import utils from '../../utils';
|
||||
import mermaidAPI from '../../mermaidAPI';
|
||||
import common from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -641,7 +641,7 @@ export default {
|
||||
getAxisFormat,
|
||||
setTodayMarker,
|
||||
getTodayMarker,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
setAccDescription,
|
||||
getAccDescription,
|
||||
|
@ -177,7 +177,7 @@ describe('when using the ganttDb', function () {
|
||||
});
|
||||
|
||||
it('should maintain the order in which tasks are created', function () {
|
||||
ganttDb.setTitle('Project Execution');
|
||||
ganttDb.setAccTitle('Project Execution');
|
||||
ganttDb.setDateFormat('YYYY-MM-DD');
|
||||
ganttDb.addSection('section A section');
|
||||
ganttDb.addTask('Completed task', 'done, des1, 2014-01-06,2014-01-08');
|
||||
|
@ -128,8 +128,8 @@ statement
|
||||
| excludes {yy.setExcludes($1.substr(9));$$=$1.substr(9);}
|
||||
| includes {yy.setIncludes($1.substr(9));$$=$1.substr(9);}
|
||||
| todayMarker {yy.setTodayMarker($1.substr(12));$$=$1.substr(12);}
|
||||
| title {yy.setTitle($1.substr(6));$$=$1.substr(6);}
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| title {yy.setAccTitle($1.substr(6));$$=$1.substr(6);}
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } | section {yy.addSection($1.substr(8));$$=$1.substr(8);}
|
||||
| clickStatement
|
||||
|
@ -5,7 +5,7 @@ import * as configApi from '../../config';
|
||||
import { getConfig } from '../../config';
|
||||
import common from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -25,6 +25,7 @@ let direction = 'LR';
|
||||
let seq = 0;
|
||||
|
||||
function getId() {
|
||||
// eslint-disable-line
|
||||
return random({ length: 7 });
|
||||
}
|
||||
|
||||
@ -411,7 +412,7 @@ export default {
|
||||
getCurrentBranch,
|
||||
getDirection,
|
||||
getHead,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
|
@ -102,7 +102,7 @@ line
|
||||
statement
|
||||
: commitStatement
|
||||
| mergeStatement
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } | section {yy.addSection($1.substr(8));$$=$1.substr(8);}
|
||||
| branchStatement
|
||||
|
@ -70,7 +70,7 @@ statement
|
||||
:
|
||||
| txt value { yy.addSection($1,yy.cleanupValue($2)); }
|
||||
| title title_value { $$=$2.trim();yy.setPieTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } | section {yy.addSection($1.substr(8));$$=$1.substr(8);}
|
||||
| directive
|
||||
|
@ -3,7 +3,7 @@ import mermaidAPI from '../../mermaidAPI';
|
||||
import * as configApi from '../../config';
|
||||
import common from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -68,7 +68,7 @@ export default {
|
||||
getSections,
|
||||
cleanupValue,
|
||||
clear,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
setPieTitle,
|
||||
getPieTitle,
|
||||
|
@ -101,7 +101,7 @@ start
|
||||
directive
|
||||
: openDirective typeDirective closeDirective
|
||||
| openDirective typeDirective ':' argDirective closeDirective
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
|
||||
;
|
||||
|
@ -3,7 +3,7 @@ import { log } from '../../logger';
|
||||
import mermaidAPI from '../../mermaidAPI';
|
||||
import common from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -162,7 +162,7 @@ export default {
|
||||
setNewReqText,
|
||||
setNewReqRisk,
|
||||
setNewReqVerifyMethod,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
setAccDescription,
|
||||
getAccDescription,
|
||||
|
@ -138,7 +138,7 @@ statement
|
||||
| details_statement 'NEWLINE'
|
||||
| title {yy.setDiagramTitle($1.substring(6));$$=$1.substring(6);}
|
||||
| legacy_title {yy.setDiagramTitle($1.substring(7));$$=$1.substring(7);}
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
|
||||
| 'loop' restOfLine document end
|
||||
|
@ -3,7 +3,7 @@ import * as configApi from '../../config';
|
||||
import { log } from '../../logger';
|
||||
import { sanitizeText } from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -417,8 +417,8 @@ export const apply = function (param) {
|
||||
case 'altEnd':
|
||||
addSignal(undefined, undefined, undefined, param.signalType);
|
||||
break;
|
||||
case 'setTitle':
|
||||
setTitle(param.text);
|
||||
case 'setAccTitle':
|
||||
setAccTitle(param.text);
|
||||
break;
|
||||
case 'parStart':
|
||||
addSignal(undefined, undefined, param.parText, param.signalType);
|
||||
@ -460,7 +460,7 @@ export default {
|
||||
ARROWTYPE,
|
||||
PLACEMENT,
|
||||
addNote,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
setDiagramTitle,
|
||||
apply,
|
||||
setAccDescription,
|
||||
|
@ -204,7 +204,7 @@ statement
|
||||
| note NOTE_TEXT AS ID
|
||||
| directive
|
||||
| direction
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); } ;
|
||||
|
||||
|
@ -4,7 +4,7 @@ import mermaidAPI from '../../mermaidAPI';
|
||||
import common from '../common/common';
|
||||
import * as configApi from '../../config';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -294,7 +294,7 @@ export default {
|
||||
extract,
|
||||
trimColon,
|
||||
getTitle,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import mermaidAPI from '../../mermaidAPI';
|
||||
import * as configApi from '../../config';
|
||||
import common from '../common/common';
|
||||
import {
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
getAccDescription,
|
||||
setAccDescription,
|
||||
@ -126,7 +126,7 @@ export default {
|
||||
parseDirective,
|
||||
getConfig: () => configApi.getConfig().journey,
|
||||
clear,
|
||||
setTitle,
|
||||
setAccTitle,
|
||||
getTitle,
|
||||
setAccDescription,
|
||||
getAccDescription,
|
||||
|
@ -43,7 +43,7 @@ describe('when using the journeyDb', function () {
|
||||
});
|
||||
|
||||
describe('tasks and actors should be added', function () {
|
||||
journeyDb.setTitle('Shopping');
|
||||
journeyDb.setAccTitle('Shopping');
|
||||
journeyDb.setAccDescription('A user journey for family shopping');
|
||||
journeyDb.addSection('Journey to the shops');
|
||||
journeyDb.addTask('Get car keys', ':5:Dad');
|
||||
|
@ -73,8 +73,8 @@ directive
|
||||
;
|
||||
|
||||
statement
|
||||
: title {yy.setTitle($1.substr(6));$$=$1.substr(6);}
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setTitle($$); }
|
||||
: title {yy.setAccTitle($1.substr(6));$$=$1.substr(6);}
|
||||
| acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }
|
||||
| acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }
|
||||
| acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }
|
||||
| section {yy.addSection($1.substr(8));$$=$1.substr(8);}
|
||||
|
@ -31,7 +31,6 @@ const themes = {
|
||||
export const calcThemeVariables = (theme, userOverRides) => theme.calcColors(userOverRides);
|
||||
|
||||
const getStyles = (type, userStyles, options) => {
|
||||
//console.warn('options in styles: ', options);
|
||||
return ` {
|
||||
font-family: ${options.fontFamily};
|
||||
font-size: ${options.fontSize};
|
||||
|
@ -10,33 +10,15 @@ class Theme {
|
||||
this.background = '#f4f4f4';
|
||||
this.darkMode = false;
|
||||
|
||||
// this.background = '#0c0c0c';
|
||||
// this.darkMode = true;
|
||||
this.primaryColor = '#fff4dd';
|
||||
// this.background = '#0c0c0c';
|
||||
// this.primaryColor = '#1f1f00';
|
||||
|
||||
this.noteBkgColor = '#fff5ad';
|
||||
this.noteTextColor = '#333';
|
||||
|
||||
// dark
|
||||
|
||||
// this.primaryColor = '#034694';
|
||||
// this.primaryColor = '#f2ee7e';
|
||||
// this.primaryColor = '#9f33be';
|
||||
// this.primaryColor = '#f0fff0';
|
||||
// this.primaryColor = '#fa255e';
|
||||
// this.primaryColor = '#ECECFF';
|
||||
|
||||
// this.secondaryColor = '#c39ea0';
|
||||
// this.tertiaryColor = '#f8e5e5';
|
||||
|
||||
// this.secondaryColor = '#dfdfde';
|
||||
// this.tertiaryColor = '#CCCCFF';
|
||||
|
||||
this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
||||
this.fontSize = '16px';
|
||||
// this.updateColors();
|
||||
}
|
||||
updateColors() {
|
||||
// The || is to make sure that if the variable has been defiend by a user override that value is to be used
|
||||
|
Loading…
x
Reference in New Issue
Block a user