Socket
Socket
Sign inDemoInstall

@contentful/field-editor-shared

Package Overview
Dependencies
Maintainers
4
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/field-editor-shared - npm Package Compare versions

Comparing version 1.4.8 to 1.4.9

dist/cjs/CharValidation.js

10

dist/cjs/CharCounter.js

@@ -66,15 +66,13 @@ "use strict";

function CharCounter(props) {
const { constraints, value, checkConstraint } = props;
let count = 0;
if (value) {
count = value.length;
if (props.value) {
count = props.value.length;
}
const valid = count === 0 || checkConstraint(count);
const valid = count === 0 || props.checkConstraint(count);
return _react.createElement("span", {
"data-status-code": valid ? null : 'invalid-size',
"data-test-id": "cf-ui-char-counter",
className: (0, _emotion.cx)({
[styles.invalid]: !valid
})
}, constraints.type === 'min' ? `${count}` : `${count} / ${constraints.max}`);
}, count, " characters");
}

4

dist/cjs/index.js

@@ -27,2 +27,5 @@ "use strict";

},
CharValidation: function() {
return _CharValidation.CharValidation;
},
ConstraintsUtils: function() {

@@ -106,2 +109,3 @@ return _constraints;

const _CharCounter = require("./CharCounter");
const _CharValidation = require("./CharValidation");
const _FieldConnector = require("./FieldConnector");

@@ -108,0 +112,0 @@ const _PredefinedValuesError = require("./PredefinedValuesError");

@@ -10,15 +10,13 @@ import * as React from 'react';

export function CharCounter(props) {
const { constraints, value, checkConstraint } = props;
let count = 0;
if (value) {
count = value.length;
if (props.value) {
count = props.value.length;
}
const valid = count === 0 || checkConstraint(count);
const valid = count === 0 || props.checkConstraint(count);
return React.createElement("span", {
"data-status-code": valid ? null : 'invalid-size',
"data-test-id": "cf-ui-char-counter",
className: cx({
[styles.invalid]: !valid
})
}, constraints.type === 'min' ? `${count}` : `${count} / ${constraints.max}`);
}, count, " characters");
}
export { AccessAPI, AppConfigAPI, BaseAppSDK, ContentType, DialogsAPI, EntryAPI, EntryFieldAPI, FieldAPI, FieldAppSDK, IdsAPI, LocalesAPI, LocationAPI, NavigatorAPI, NotifierAPI, OpenCustomWidgetOptions, ParametersAPI, SpaceAPI, WindowAPI } from '@contentful/app-sdk';
export { CharCounter } from './CharCounter';
export { CharValidation } from './CharValidation';
export { FieldConnector } from './FieldConnector';

@@ -4,0 +5,0 @@ export { PredefinedValuesError } from './PredefinedValuesError';

/// <reference types="react" />
import { ValidationType } from 'types';
interface CharCounterProps {
value?: string;
checkConstraint: (n: number) => boolean;
constraints: ValidationType;
}
export declare function CharCounter(props: CharCounterProps): JSX.Element;
export {};
export { AccessAPI, AppConfigAPI, BaseAppSDK, ContentType, DialogsAPI, EntryAPI, EntryFieldAPI, FieldAPI, FieldAppSDK, IdsAPI, LocalesAPI, LocationAPI, NavigatorAPI, NotifierAPI, OpenCustomWidgetOptions, ParametersAPI, SpaceAPI, WindowAPI, } from '@contentful/app-sdk';
export { CharCounter } from './CharCounter';
export { CharValidation } from './CharValidation';
export { FieldConnector } from './FieldConnector';

@@ -4,0 +5,0 @@ export type { FieldConnectorChildProps } from './FieldConnector';

{
"name": "@contentful/field-editor-shared",
"version": "1.4.8",
"version": "1.4.9",
"main": "dist/cjs/index.js",

@@ -54,3 +54,3 @@ "module": "dist/esm/index.js",

},
"gitHead": "1d7d630fe6f9576ee4cf35feed8badc8440acbf1"
"gitHead": "29cf5fb16a8d61f6c23678dad618c61aceec320d"
}
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