Skip to content

Commit

Permalink
Merge 710784c into 54325ce
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim9999 authored Jul 31, 2022
2 parents 54325ce + 710784c commit fe60f8b
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 97 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"dependencies": {
"atherdon-newsletter-js-layouts-body": "^3.2.0",
"atherdon-newsletter-js-layouts-typography": "^3.0.0",
"atherdon-newsletter-react-layouts-typography": "^0.4.0",
"atherdon-old-newsletter-js-outertemplate": "^3.7.0",
"chalk": "5.0.1",
"cross-env": "7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/callbacksReact/methods/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function _header(text, chars, content) {
content: content.trim(),
};

const titleTypes = ['mainTitle', 'subtitle', 'heading'];
const titleTypes = ['header', 'title', 'subtitle'];
const name = titleTypes[chars.length - 1];

const config = {
Expand Down
7 changes: 2 additions & 5 deletions src/domain/react/Replacer.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ class Replacer {
constructor() {
this.replaceMDBinded = () => {};

// this.replaceMDBindedPreviewText = () => {};

this.previewText = () => this.replaceMDBinded('previewText');

// this.previewText = () => this.replaceMDBinded('previewText');
this.comments = () => this.replaceMDBinded('empty');
this.strong = () => this.replaceMDBinded('strong');
this.italic = () => this.replaceMDBinded('italic');
Expand Down Expand Up @@ -41,7 +38,7 @@ class Replacer {
}

typography() {
this.previewText();
// this.previewText();
//---------------
this.strong();
this.italic();
Expand Down
73 changes: 33 additions & 40 deletions src/domain/react/pre-replace-object/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import typography from 'atherdon-newsletter-react-layouts-typography';
import { Callbacks } from '../../../callbacksReact';

import {
Expand All @@ -6,8 +7,8 @@ import {
REGEXP_LINK,
REGEXP_STRONG,
REGEXP_DEL,
// REGEXP_Q,
// REGEXP_CODE,
REGEXP_Q,
REGEXP_CODE,
// REGEXP_UL_LIST,
// REGEXP_OL_LIST,
REGEXP_BLOCKQUOTE,
Expand All @@ -16,13 +17,11 @@ import {
REGEXP_EM,
// REGEXP_SPONSORSHIP,
// REGEXP_MEM,
REGEXP_PREVIEW_TEXT,
// REGEXP_PREVIEW_TEXT,
REGEXP_PARAGRAPH,
// REGEXP_SEPARATOR,
} from '../../../constants/index';

import * as typography from '../../../templates/NewsletterReactTemplate/typography';

import objectBuilder from '../../md/object-builder';

const {
Expand All @@ -33,8 +32,8 @@ const {
_header,
_italic,
_del,
// _q,
// _code,
_q,
_code,
_hr,
// _empty,
//------------
Expand All @@ -48,46 +47,40 @@ const {
//------------
// _separator,

_previewText,
// _previewText,
} = Callbacks;

const {
headingLiteral,
imageLiteral,
italicLiteral,
linkLiteral,
// listLiteral,
// listItemLiteral,
titleLiteral,
paragraphLiteral,
// qLiteral,
strongLiteral,
subtitleLiteral,
// separatorLiteral,
//----------
// blockquoteLiteral,
// codeLiteral,
// delLiteral,
previewTextLiteral,
headingComponent,
imageComponent,
italicComponent,
linkComponent,
mainTitleComponent,
paragraphComponent,
strongComponent,
subtitleComponent,
qComponent,
codeComponent,
} = typography;

const map = {
strong: objectBuilder(REGEXP_STRONG, _strong, strongLiteral),
link: objectBuilder(REGEXP_LINK, _link, linkLiteral),
strong: objectBuilder(REGEXP_STRONG, _strong, strongComponent),
link: objectBuilder(REGEXP_LINK, _link, linkComponent),
del: objectBuilder(REGEXP_DEL, _del, false),
image: objectBuilder(REGEXP_IMAGE, _image, imageLiteral),
previewText: objectBuilder(
REGEXP_PREVIEW_TEXT,
_previewText,
previewTextLiteral,
),
italic: objectBuilder(REGEXP_EM, _italic, italicLiteral),
header: objectBuilder(REGEXP_HEADER, _header, headingLiteral),
image: objectBuilder(REGEXP_IMAGE, _image, imageComponent),
// TODO find out what module to use to import previewText
// previewText: objectBuilder(
// REGEXP_PREVIEW_TEXT,
// _previewText,
// previewTextLiteral,
// ),
italic: objectBuilder(REGEXP_EM, _italic, italicComponent),
header: objectBuilder(REGEXP_HEADER, _header, headingComponent),
// TODO header arent working as suppose too
subtitle: objectBuilder(REGEXP_HEADER, _header, subtitleLiteral),
title: objectBuilder(REGEXP_HEADER, _header, titleLiteral),
// q:objectBuilder(REGEXP_Q, _q, false),
// code:objectBuilder(REGEXP_CODE, _code, false),
subtitle: objectBuilder(REGEXP_HEADER, _header, subtitleComponent),
title: objectBuilder(REGEXP_HEADER, _header, mainTitleComponent),
q: objectBuilder(REGEXP_Q, _q, qComponent),
code: objectBuilder(REGEXP_CODE, _code, codeComponent),

// listItem:objectBuilder(
// REGEXP_SUB_LISTS,
Expand All @@ -102,7 +95,7 @@ const map = {
// olList:objectBuilder(REGEXP_OL_LIST, _olList, false),
blockquote: objectBuilder(REGEXP_BLOCKQUOTE, _blockquote, false),
hr: objectBuilder(REGEXP_HR, _hr, false),
paragraph: objectBuilder(REGEXP_PARAGRAPH, _paragraph, paragraphLiteral),
paragraph: objectBuilder(REGEXP_PARAGRAPH, _paragraph, paragraphComponent),
br: objectBuilder(REGEXP_BR, _br),
};
// sponsorship:objectBuilder(
Expand Down
35 changes: 0 additions & 35 deletions src/templates/NewsletterReactTemplate/typography/index.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit fe60f8b

Please sign in to comment.