Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wix-rich-content-viewer

Package Overview
Dependencies
Maintainers
12
Versions
1160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wix-rich-content-viewer - npm Package Compare versions

Comparing version 9.14.3 to 9.14.4

dist/es/getPluginViewers-62cd2483.js

10

dist/es/components/Anchor.js

@@ -1,2 +0,10 @@

import o from"react";const a=o.memo(({anchorKey:e,type:t})=>o.createElement("div",{key:e,type:t,"data-hook":e}));export{a as default};
import React from 'react';
const Anchor = React.memo(({ anchorKey, type }) => (
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
/* @__PURE__ */ React.createElement("div", { key: anchorKey, type, "data-hook": anchorKey })
));
export { Anchor as default };
//# sourceMappingURL=Anchor.js.map

@@ -1,2 +0,20 @@

import t from"react";class e extends t.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(r){return{hasError:!0}}render(){return this.state.hasError?null:this.props.children}}export{e as ErrorBoundary};
import React from 'react';
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(error) {
return { hasError: true };
}
render() {
if (this.state.hasError) {
return null;
}
return this.props.children;
}
}
export { ErrorBoundary };
//# sourceMappingURL=ErrorBoundary.js.map

@@ -1,2 +0,19 @@

import"react";import"prop-types";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"wix-rich-content-common";import"./utils/draftUtils.js";import{g as k}from"./getPluginViewers-096a0b8f.js";import"./withInteraction.js";import"./components/Anchor.js";import"./components/ErrorBoundary.js";import"punycode";import"./List-9aac142d.js";import"./utils/textUtils.js";import"./inlineStyleMapper.js";import"./utils/combineMappers.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./utils/getInteractionWrapper.js";export{k as default};
import 'react';
import 'prop-types';
import 'classnames';
import 'lodash';
import './utils/paywallSeo.js';
import 'wix-rich-content-common';
import './utils/draftUtils.js';
export { g as default } from './getPluginViewers-62cd2483.js';
import './withInteraction.js';
import './components/Anchor.js';
import './components/ErrorBoundary.js';
import 'punycode';
import './List-57c89c95.js';
import './utils/textUtils.js';
import './inlineStyleMapper.js';
import './utils/combineMappers.js';
import 'wix-rich-content-common/libs/deprecateHelpers';
import './utils/getInteractionWrapper.js';
//# sourceMappingURL=getPluginViewers.js.map

@@ -1,2 +0,50 @@

import m,{Component as n}from"react";import a from"wix-rich-content-common/dist/statics/viewer/locale/messages_en.json";import{withI18n as l}from"wix-rich-content-common";import{y as c}from"./getPluginViewers-096a0b8f.js";import"prop-types";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"punycode";import"./List-9aac142d.js";import"./utils/textUtils.js";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";import"./components/Anchor.js";import"./components/ErrorBoundary.js";import"./inlineStyleMapper.js";import"wix-rich-content-common/libs/deprecateHelpers";var f=Object.defineProperty,p=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,e=(t,r,o)=>r in t?f(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o,y=(t,r)=>{for(var o in r||(r={}))s.call(r,o)&&e(t,o,r[o]);if(p)for(var o of p(r))b.call(r,o)&&e(t,o,r[o]);return t};const u=l(c,a,{forceRemount:!1});class i extends n{render(){return m.createElement(u,y({},this.props))}}i.displayName="RichContentViewer";export{i as default};
import React, { Component } from 'react';
import englishResources from 'wix-rich-content-common/dist/statics/viewer/locale/messages_en.json';
import { withI18n } from 'wix-rich-content-common';
import { R as RichContentViewer } from './getPluginViewers-62cd2483.js';
import 'prop-types';
import 'classnames';
import 'lodash';
import './utils/paywallSeo.js';
import './utils/draftUtils.js';
import 'punycode';
import './List-57c89c95.js';
import './utils/textUtils.js';
import './withInteraction.js';
import './utils/getInteractionWrapper.js';
import './utils/combineMappers.js';
import './components/Anchor.js';
import './components/ErrorBoundary.js';
import './inlineStyleMapper.js';
import 'wix-rich-content-common/libs/deprecateHelpers';
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
const WrappedViewer = withI18n(
RichContentViewer,
englishResources,
{ forceRemount: false }
);
class I18nRichContentViewer extends Component {
render() {
return /* @__PURE__ */ React.createElement(WrappedViewer, __spreadValues({}, this.props));
}
}
I18nRichContentViewer.displayName = "RichContentViewer";
export { I18nRichContentViewer as default };
//# sourceMappingURL=I18nRichContentViewer.js.map

@@ -1,4 +0,23 @@

import{default as u}from"./I18nRichContentViewer.js";import{F,w as H}from"./getPluginViewers-096a0b8f.js";import"react";import"wix-rich-content-common/dist/statics/viewer/locale/messages_en.json";import"wix-rich-content-common";import"prop-types";import"classnames";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"punycode";import"./List-9aac142d.js";import"./utils/textUtils.js";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";import"./components/Anchor.js";import"./components/ErrorBoundary.js";import"./inlineStyleMapper.js";import"wix-rich-content-common/libs/deprecateHelpers";export{u as RichContentViewer,F as convertToHTML,H as convertToReact};
export { default as RichContentViewer } from './I18nRichContentViewer.js';
export { a as convertToHTML, c as convertToReact } from './getPluginViewers-62cd2483.js';
import 'react';
import 'wix-rich-content-common/dist/statics/viewer/locale/messages_en.json';
import 'wix-rich-content-common';
import 'prop-types';
import 'classnames';
import 'lodash';
import './utils/paywallSeo.js';
import './utils/draftUtils.js';
import 'punycode';
import './List-57c89c95.js';
import './utils/textUtils.js';
import './withInteraction.js';
import './utils/getInteractionWrapper.js';
import './utils/combineMappers.js';
import './components/Anchor.js';
import './components/ErrorBoundary.js';
import './inlineStyleMapper.js';
import 'wix-rich-content-common/libs/deprecateHelpers';
//# sourceMappingURL=index.js.map
import 'wix-rich-content-viewer/dist/es/styles.editor.min.global.css'

@@ -1,2 +0,23 @@

import a from"react";import{getDynamicInlineStyleMapper as y,RICOS_TEXT_COLOR_TYPE as r,RICOS_TEXT_HIGHLIGHT_TYPE as m,RICOS_FONT_SIZE_TYPE as l}from"wix-rich-content-common";const E=y(r),I=y(m),o=y(l),s=n=>({BOLD:(e,{key:t})=>a.createElement("strong",{key:t},e),ITALIC:(e,{key:t})=>a.createElement("em",{key:t},e),UNDERLINE:(e,{key:t})=>a.createElement("u",{key:t,className:n.underline},e),CODE:(e,{key:t})=>a.createElement("span",{key:t,className:n.code},e),NOT_BOLD:(e,{key:t})=>a.createElement("span",{style:{fontWeight:"normal"},key:t},e),NOT_ITALIC:(e,{key:t})=>a.createElement("span",{style:{fontStyle:"normal"},key:t},e)}),T=(n,e)=>[s,o({},n),E(e,n),I(e,n)];export{T as getViewerInlineStyleMappers};
import React from 'react';
import { getDynamicInlineStyleMapper, RICOS_TEXT_COLOR_TYPE, RICOS_TEXT_HIGHLIGHT_TYPE, RICOS_FONT_SIZE_TYPE } from 'wix-rich-content-common';
const textColorInlineStyleMapper = getDynamicInlineStyleMapper(RICOS_TEXT_COLOR_TYPE);
const textHighlightInlineStyleMapper = getDynamicInlineStyleMapper(RICOS_TEXT_HIGHLIGHT_TYPE);
const fontSizeInlineStyleMapper = getDynamicInlineStyleMapper(RICOS_FONT_SIZE_TYPE);
const staticInlineStyleMapper = (mergedStyles) => ({
BOLD: (children, { key }) => /* @__PURE__ */ React.createElement("strong", { key }, children),
ITALIC: (children, { key }) => /* @__PURE__ */ React.createElement("em", { key }, children),
UNDERLINE: (children, { key }) => /* @__PURE__ */ React.createElement("u", { key, className: mergedStyles.underline }, children),
CODE: (children, { key }) => /* @__PURE__ */ React.createElement("span", { key, className: mergedStyles.code }, children),
NOT_BOLD: (children, { key }) => /* @__PURE__ */ React.createElement("span", { style: { fontWeight: "normal" }, key }, children),
NOT_ITALIC: (children, { key }) => /* @__PURE__ */ React.createElement("span", { style: { fontStyle: "normal" }, key }, children)
});
const getViewerInlineStyleMappers = (contentState, config) => [
staticInlineStyleMapper,
fontSizeInlineStyleMapper({}, contentState),
textColorInlineStyleMapper(config, contentState),
textHighlightInlineStyleMapper(config, contentState)
];
export { getViewerInlineStyleMappers };
//# sourceMappingURL=inlineStyleMapper.js.map

@@ -1,2 +0,12 @@

import"react";import"prop-types";import"classnames";import"./utils/textUtils.js";import"./utils/paywallSeo.js";import"wix-rich-content-common";import{H as u}from"./List-9aac142d.js";import"./withInteraction.js";import"lodash";import"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";export{u as default};
import 'react';
import 'prop-types';
import 'classnames';
import './utils/textUtils.js';
import './utils/paywallSeo.js';
import 'wix-rich-content-common';
export { L as default } from './List-57c89c95.js';
import './withInteraction.js';
import 'lodash';
import './utils/getInteractionWrapper.js';
import './utils/combineMappers.js';
//# sourceMappingURL=List.js.map

@@ -1,2 +0,19 @@

import"react";import"classnames";import"wix-rich-content-common";import{y as j}from"./getPluginViewers-096a0b8f.js";import"./List-9aac142d.js";import"wix-rich-content-common/libs/deprecateHelpers";import"./utils/combineMappers.js";import"prop-types";import"lodash";import"./utils/paywallSeo.js";import"./utils/draftUtils.js";import"punycode";import"./withInteraction.js";import"./utils/getInteractionWrapper.js";import"./components/Anchor.js";import"./components/ErrorBoundary.js";import"./utils/textUtils.js";import"./inlineStyleMapper.js";export{j as default};
import 'react';
import 'classnames';
import 'wix-rich-content-common';
export { R as default } from './getPluginViewers-62cd2483.js';
import './List-57c89c95.js';
import 'wix-rich-content-common/libs/deprecateHelpers';
import './utils/combineMappers.js';
import 'prop-types';
import 'lodash';
import './utils/paywallSeo.js';
import './utils/draftUtils.js';
import 'punycode';
import './withInteraction.js';
import './utils/getInteractionWrapper.js';
import './components/Anchor.js';
import './components/ErrorBoundary.js';
import './utils/textUtils.js';
import './inlineStyleMapper.js';
//# sourceMappingURL=RichContentViewer.js.map

@@ -1,2 +0,10 @@

const s=(e,...t)=>!e||!e.length||e.some(o=>typeof o!="function")?(console.warn(`${e} is expected to be a function array`),{}):e.reduce((o,c)=>Object.assign(o,c(...t)),{});export{s as combineMappers};
const combineMappers = (mappers, ...args) => {
if (!mappers || !mappers.length || mappers.some((resolver) => typeof resolver !== "function")) {
console.warn(`${mappers} is expected to be a function array`);
return {};
}
return mappers.reduce((map, mapper) => Object.assign(map, mapper(...args)), {});
};
export { combineMappers };
//# sourceMappingURL=combineMappers.js.map

@@ -1,2 +0,19 @@

import"react";import"wix-rich-content-common";import{F as M,w as R}from"../getPluginViewers-096a0b8f.js";import"classnames";import"lodash";import"../List-9aac142d.js";import"./paywallSeo.js";import"./textUtils.js";import"../inlineStyleMapper.js";import"./combineMappers.js";import"../components/Anchor.js";import"../withInteraction.js";import"../components/ErrorBoundary.js";import"prop-types";import"./draftUtils.js";import"punycode";import"wix-rich-content-common/libs/deprecateHelpers";import"./getInteractionWrapper.js";export{M as convertToHTML,R as convertToReact};
import 'react';
import 'wix-rich-content-common';
export { a as convertToHTML, c as convertToReact } from '../getPluginViewers-62cd2483.js';
import 'classnames';
import 'lodash';
import '../List-57c89c95.js';
import './paywallSeo.js';
import './textUtils.js';
import '../inlineStyleMapper.js';
import './combineMappers.js';
import '../components/Anchor.js';
import '../withInteraction.js';
import '../components/ErrorBoundary.js';
import 'prop-types';
import './draftUtils.js';
import 'punycode';
import 'wix-rich-content-common/libs/deprecateHelpers';
import './getInteractionWrapper.js';
//# sourceMappingURL=convertContentState.js.map

4

dist/es/utils/draftUtils.js

@@ -1,2 +0,4 @@

const c=(e,n)=>e.blocks.findIndex(o=>o.key===n);export{c as getBlockIndex};
const getBlockIndex = (content, blockKey) => content.blocks.findIndex((block) => block.key === blockKey);
export { getBlockIndex };
//# sourceMappingURL=draftUtils.js.map

@@ -1,2 +0,33 @@

import v from"react";import{combineMappers as y}from"./combineMappers.js";var E=Object.defineProperty,n=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,o=(t,e,r)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,a=(t,e)=>{for(var r in e||(e={}))O.call(e,r)&&o(t,r,e[r]);if(n)for(var r of n(e))d.call(e,r)&&o(t,r,e[r]);return t};const c=({children:t})=>t,g=({interactions:t,context:e})=>({children:r})=>{const{config:p}=e,{contentInteractionMappers:i=[],onPreviewExpand:l=()=>{}}=p.PREVIEW||{},s=y(i,l);return t.reduce((b,{type:f,settings:u})=>{const m=s[f]||c;return v.createElement(m,a(a({},u),e),b)},r)};export{c as DefaultInteractionWrapper,g as getInteractionWrapper};
import React from 'react';
import { combineMappers } from './combineMappers.js';
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
const DefaultInteractionWrapper = ({ children }) => children;
const getInteractionWrapper = ({ interactions, context }) => ({ children }) => {
const { config } = context;
const { contentInteractionMappers = [], onPreviewExpand = () => {
} } = config.PREVIEW || {};
const interactionMap = combineMappers(contentInteractionMappers, onPreviewExpand);
return interactions.reduce((child, { type, settings }) => {
const Interaction = interactionMap[type] || DefaultInteractionWrapper;
return /* @__PURE__ */ React.createElement(Interaction, __spreadValues(__spreadValues({}, settings), context), child);
}, children);
};
export { DefaultInteractionWrapper, getInteractionWrapper };
//# sourceMappingURL=getInteractionWrapper.js.map

@@ -1,2 +0,5 @@

const o=({className:a="paywall",index:e=3},l)=>l<e&&a,s=a=>typeof a=="object"&&typeof a.paywall=="object";export{o as getPaywallSeoClass,s as isPaywallSeo};
const getPaywallSeoClass = ({ className = "paywall", index = 3 }, blockIndex) => blockIndex < index && className;
const isPaywallSeo = (seoMode) => typeof seoMode === "object" && typeof seoMode.paywall === "object";
export { getPaywallSeoClass, isPaywallSeo };
//# sourceMappingURL=paywallSeo.js.map

@@ -1,2 +0,27 @@

const o=r=>r.replace(/-([a-z])/,(a,e)=>e.toUpperCase()),s=(r={})=>Object.keys(r).reduce((a,e)=>(a[o(e)]=r[e],a),{}),t=r=>r?typeof r=="string"?r.trim().length>0:Array.isArray(r)?t(r[0])||t(r[1]):typeof r=="object"?t(r.props.children):!1:!1,i=()=>{var r;return/^((?!chrome).)*safari|firefox|fxios/i.test((r=global.navigator)==null?void 0:r.userAgent)};export{t as hasText,s as kebabToCamelObjectKeys,i as safariOrFirefox};
const kebabToCamel = (s) => s.replace(/-([a-z])/, (_, p1) => p1.toUpperCase());
const kebabToCamelObjectKeys = (obj = {}) => Object.keys(obj).reduce((result, key) => {
result[kebabToCamel(key)] = obj[key];
return result;
}, {});
const hasText = (child) => {
if (!child) {
return false;
}
if (typeof child === "string") {
return child.trim().length > 0;
}
if (Array.isArray(child)) {
return hasText(child[0]) || hasText(child[1]);
} else if (typeof child === "object") {
return hasText(child.props.children);
} else {
return false;
}
};
const safariOrFirefox = () => {
var _a;
return /^((?!chrome).)*safari|firefox|fxios/i.test((_a = global.navigator) == null ? void 0 : _a.userAgent);
};
export { hasText, kebabToCamelObjectKeys, safariOrFirefox };
//# sourceMappingURL=textUtils.js.map

@@ -1,2 +0,17 @@

import p from"react";import{isArray as a}from"lodash";import{getInteractionWrapper as l}from"./utils/getInteractionWrapper.js";import"./utils/combineMappers.js";const m=(t,n,r)=>{var e,o;const{config:i}=r;if(!((o=(e=i.PREVIEW)==null?void 0:e.contentInteractionMappers)!=null&&o.length)||!i.PREVIEW.onPreviewExpand||!a(n))return t;const c=l({interactions:n,context:r});return p.createElement(c,null,t)};export{m as withInteraction};
import React from 'react';
import { isArray } from 'lodash';
import { getInteractionWrapper } from './utils/getInteractionWrapper.js';
import './utils/combineMappers.js';
const withInteraction = (element, interactions, context) => {
var _a, _b;
const { config } = context;
if (!((_b = (_a = config.PREVIEW) == null ? void 0 : _a.contentInteractionMappers) == null ? void 0 : _b.length) || !config.PREVIEW.onPreviewExpand || !isArray(interactions)) {
return element;
}
const BlockInteractionWrapper = getInteractionWrapper({ interactions, context });
return /* @__PURE__ */ React.createElement(BlockInteractionWrapper, null, element);
};
export { withInteraction };
//# sourceMappingURL=withInteraction.js.map
{
"name": "wix-rich-content-viewer",
"version": "9.14.3",
"version": "9.14.4",
"author": {

@@ -50,3 +50,3 @@ "name": "Jonathan Bachman",

"wix-redraft": "^1.1.2",
"wix-rich-content-common": "9.14.3"
"wix-rich-content-common": "9.14.4"
},

@@ -61,3 +61,3 @@ "peerDependencies": {

"devDependencies": {
"wix-rich-content-plugin-image": "9.14.3"
"wix-rich-content-plugin-image": "9.14.4"
},

@@ -64,0 +64,0 @@ "unpkg": true,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc