Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Commit

Permalink
[link] refactor(link-parse-strategy): moved viewer => link
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgreen committed Jul 15, 2018
1 parent f91bfe5 commit dd40ed5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getUrlMatches } from 'wix-rich-content-common';

export const LinkStrategy = (contentBlock, callback) => {
export const LinkParseStrategy = (contentBlock, callback) => {
const text = contentBlock.getText();
if (!text) {
return [];
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-link/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { createLinkPlugin } from './createLinkPlugin';
export { EXTERNAL_LINK_TYPE, LINK_TYPE } from './types';
export { typeMapper as linkTypeMapper } from './typeMapper';
export { default as LinkViewer } from './LinkViewer';
export { LinkParseStrategy } from './LinkParseStrategy';
6 changes: 3 additions & 3 deletions packages/viewer-example/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { Component } from 'react';
import ReactModal from 'react-modal';
import MobileDetect from 'mobile-detect';
import { RichContentModal, mergeStyles, Button, normalizeInitialState } from 'wix-rich-content-common';
import { LinkStrategy, RichContentViewer } from 'wix-rich-content-viewer'; // TODO: move LinkStrategy to link-plugin
import { RichContentViewer } from 'wix-rich-content-viewer';
import RichContentRawDataViewer from './RichContentRawDataViewer';

import { videoTypeMapper } from 'wix-rich-content-plugin-video';
import { imageTypeMapper } from 'wix-rich-content-plugin-image';
import { galleryTypeMapper } from 'wix-rich-content-plugin-gallery';
import { dividerTypeMapper } from 'wix-rich-content-plugin-divider';
import { htmlTypeMapper } from 'wix-rich-content-plugin-html';
import { linkTypeMapper, LinkViewer } from 'wix-rich-content-plugin-link';
import { linkTypeMapper, LinkViewer, LinkParseStrategy } from 'wix-rich-content-plugin-link';

import { Strategy as HashTagStrategy, Component as HashTag } from 'wix-rich-content-plugin-hashtag';

Expand Down Expand Up @@ -51,7 +51,7 @@ class App extends Component {
linkTypeMapper];

this.decorators = [{
strategy: LinkStrategy,
strategy: LinkParseStrategy,
component: ({ children, decoratedText, rel, target }) =>
<LinkViewer componentData={{ rel, target, url: decoratedText }} anchorTarget={anchorTarget} relValue={relValue}> {children} </LinkViewer>
}, {
Expand Down

0 comments on commit dd40ed5

Please sign in to comment.