Socket
Socket
Sign inDemoInstall

@contentful/field-editor-shared

Package Overview
Dependencies
Maintainers
111
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 0.25.1 to 0.26.0

123

CHANGELOG.md

@@ -6,164 +6,100 @@ # Change Log

## [0.25.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.25.0...@contentful/field-editor-shared@0.25.1) (2021-10-14)
# [0.26.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.25.1...@contentful/field-editor-shared@0.26.0) (2021-11-04)
**Note:** Version bump only for package @contentful/field-editor-shared
### Features
- Forma v4 components adoption ([#805](https://github.com/contentful/field-editors/issues/805)) ([526bde6](https://github.com/contentful/field-editors/commit/526bde6e10e0ee3789705ec10fb31489af7ca59e))
### BREAKING CHANGES
- adopts a new Forma v4 beta
## [0.25.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.25.0...@contentful/field-editor-shared@0.25.1) (2021-10-14)
**Note:** Version bump only for package @contentful/field-editor-shared
# [0.25.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.24.0...@contentful/field-editor-shared@0.25.0) (2021-10-06)
### Features
* [EXT-3161] bump app sdk to v4 ([#881](https://github.com/contentful/field-editors/issues/881)) ([9c4a2af](https://github.com/contentful/field-editors/commit/9c4a2af07da203d59fb5f15c3a5188ecc64b1d44))
- [EXT-3161] bump app sdk to v4 ([#881](https://github.com/contentful/field-editors/issues/881)) ([9c4a2af](https://github.com/contentful/field-editors/commit/9c4a2af07da203d59fb5f15c3a5188ecc64b1d44))
# [0.24.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.23.0...@contentful/field-editor-shared@0.24.0) (2021-09-17)
### Features
* add shortenStorageUnit util to shared ([#852](https://github.com/contentful/field-editors/issues/852)) ([142472b](https://github.com/contentful/field-editors/commit/142472b57fc1ca2843dd414c5320fdb5b5b11e62))
- add shortenStorageUnit util to shared ([#852](https://github.com/contentful/field-editors/issues/852)) ([142472b](https://github.com/contentful/field-editors/commit/142472b57fc1ca2843dd414c5320fdb5b5b11e62))
# [0.23.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.22.1...@contentful/field-editor-shared@0.23.0) (2021-09-16)
### Features
* export shared util to validate images ([#846](https://github.com/contentful/field-editors/issues/846)) ([f26c481](https://github.com/contentful/field-editors/commit/f26c481cc5abf275acb4e4a65b462be487708117))
- export shared util to validate images ([#846](https://github.com/contentful/field-editors/issues/846)) ([f26c481](https://github.com/contentful/field-editors/commit/f26c481cc5abf275acb4e4a65b462be487708117))
## [0.22.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.22.0...@contentful/field-editor-shared@0.22.1) (2021-08-19)
### Bug Fixes
* FieldConnector setValue race conditions ([#803](https://github.com/contentful/field-editors/issues/803)) ([15a5aa6](https://github.com/contentful/field-editors/commit/15a5aa68a6f3f6c7183444c8fd11de1e70208aa7))
- FieldConnector setValue race conditions ([#803](https://github.com/contentful/field-editors/issues/803)) ([15a5aa6](https://github.com/contentful/field-editors/commit/15a5aa68a6f3f6c7183444c8fd11de1e70208aa7))
# [0.22.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.21.0...@contentful/field-editor-shared@0.22.0) (2021-07-23)
### Features
* 💡 new color tokens ([#778](https://github.com/contentful/field-editors/issues/778)) ([fba548d](https://github.com/contentful/field-editors/commit/fba548de32305016df7f2685634eefb14294828f))
- 💡 new color tokens ([#778](https://github.com/contentful/field-editors/issues/778)) ([fba548d](https://github.com/contentful/field-editors/commit/fba548de32305016df7f2685634eefb14294828f))
# [0.21.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.18.0...@contentful/field-editor-shared@0.21.0) (2021-07-06)
### Features
* [] bump forma tokens ([#756](https://github.com/contentful/field-editors/issues/756)) ([befc60f](https://github.com/contentful/field-editors/commit/befc60f9f495b0d1e072e9cba969d139da8f674a))
- [] bump forma tokens ([#756](https://github.com/contentful/field-editors/issues/756)) ([befc60f](https://github.com/contentful/field-editors/commit/befc60f9f495b0d1e072e9cba969d139da8f674a))
# [0.20.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.18.0...@contentful/field-editor-shared@0.20.0) (2021-07-06)
### Features
* [] bump forma tokens ([#756](https://github.com/contentful/field-editors/issues/756)) ([befc60f](https://github.com/contentful/field-editors/commit/befc60f9f495b0d1e072e9cba969d139da8f674a))
- [] bump forma tokens ([#756](https://github.com/contentful/field-editors/issues/756)) ([befc60f](https://github.com/contentful/field-editors/commit/befc60f9f495b0d1e072e9cba969d139da8f674a))
# [0.19.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.18.0...@contentful/field-editor-shared@0.19.0) (2021-06-23)
### Features
* [] bump forma tokens ([#756](https://github.com/contentful/field-editors/issues/756)) ([befc60f](https://github.com/contentful/field-editors/commit/befc60f9f495b0d1e072e9cba969d139da8f674a))
- [] bump forma tokens ([#756](https://github.com/contentful/field-editors/issues/756)) ([befc60f](https://github.com/contentful/field-editors/commit/befc60f9f495b0d1e072e9cba969d139da8f674a))
# [0.18.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.17.0...@contentful/field-editor-shared@0.18.0) (2021-06-23)
### Features
* [] bump app sdk ([#755](https://github.com/contentful/field-editors/issues/755)) ([aa0c217](https://github.com/contentful/field-editors/commit/aa0c2179d4edbb1a37453e1e3bdf0ae11991166f))
- [] bump app sdk ([#755](https://github.com/contentful/field-editors/issues/755)) ([aa0c217](https://github.com/contentful/field-editors/commit/aa0c2179d4edbb1a37453e1e3bdf0ae11991166f))
# [0.17.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.16.0...@contentful/field-editor-shared@0.17.0) (2021-06-22)
### Features
* [EXT-2826] make app-sdk a peer depedency ([#748](https://github.com/contentful/field-editors/issues/748)) ([f1d1d01](https://github.com/contentful/field-editors/commit/f1d1d01d89d59d70ab2c831a513ab2580ea64d7e))
- [EXT-2826] make app-sdk a peer depedency ([#748](https://github.com/contentful/field-editors/issues/748)) ([f1d1d01](https://github.com/contentful/field-editors/commit/f1d1d01d89d59d70ab2c831a513ab2580ea64d7e))
# [0.16.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.15.1...@contentful/field-editor-shared@0.16.0) (2021-02-19)
### Features
* bump min version of forma-36 ([#606](https://github.com/contentful/field-editors/issues/606)) ([fd57c7a](https://github.com/contentful/field-editors/commit/fd57c7a4312766af38c01507f17706ab22992617))
- bump min version of forma-36 ([#606](https://github.com/contentful/field-editors/issues/606)) ([fd57c7a](https://github.com/contentful/field-editors/commit/fd57c7a4312766af38c01507f17706ab22992617))
## [0.15.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.15.0...@contentful/field-editor-shared@0.15.1) (2021-02-09)
### Bug Fixes
* **tags:** Editor permissions handles entities with metadata ([#584](https://github.com/contentful/field-editors/issues/584)) ([32636da](https://github.com/contentful/field-editors/commit/32636daf05e0ba9abb47eafe9893850db2c6601f))
- **tags:** Editor permissions handles entities with metadata ([#584](https://github.com/contentful/field-editors/issues/584)) ([32636da](https://github.com/contentful/field-editors/commit/32636daf05e0ba9abb47eafe9893850db2c6601f))
# [0.15.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.14.0...@contentful/field-editor-shared@0.15.0) (2021-02-01)
### Features
* swap ui-extension-sdk to app-sdk ([#576](https://github.com/contentful/field-editors/issues/576)) ([ac88b4b](https://github.com/contentful/field-editors/commit/ac88b4bd4573a72f521246fc8fcc873520ca90d4))
- swap ui-extension-sdk to app-sdk ([#576](https://github.com/contentful/field-editors/issues/576)) ([ac88b4b](https://github.com/contentful/field-editors/commit/ac88b4bd4573a72f521246fc8fcc873520ca90d4))
# [0.14.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.13.3...@contentful/field-editor-shared@0.14.0) (2021-01-20)
### Features
* update minimal forma-36 versions to use updated design ([#565](https://github.com/contentful/field-editors/issues/565)) ([332c734](https://github.com/contentful/field-editors/commit/332c734bfaf54f0e9773fcbb460d743b1f5459ec))
- update minimal forma-36 versions to use updated design ([#565](https://github.com/contentful/field-editors/issues/565)) ([332c734](https://github.com/contentful/field-editors/commit/332c734bfaf54f0e9773fcbb460d743b1f5459ec))
## [0.13.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.13.2...@contentful/field-editor-shared@0.13.3) (2021-01-12)

@@ -173,6 +109,2 @@

## [0.13.2](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.13.1...@contentful/field-editor-shared@0.13.2) (2020-12-16)

@@ -182,6 +114,2 @@

## [0.13.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.13.0...@contentful/field-editor-shared@0.13.1) (2020-11-06)

@@ -191,11 +119,6 @@

# [0.13.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-shared@0.12.0...@contentful/field-editor-shared@0.13.0) (2020-08-24)
### Features
* extract field component to default-field-editors package ([#365](https://github.com/contentful/field-editors/issues/365)) ([eb78219](https://github.com/contentful/field-editors/commit/eb78219d52c3dcfb91824f3106f44312aaaf1f8e))
- extract field component to default-field-editors package ([#365](https://github.com/contentful/field-editors/issues/365)) ([eb78219](https://github.com/contentful/field-editors/commit/eb78219d52c3dcfb91824f3106f44312aaaf1f8e))

17

dist/field-editor-shared.cjs.development.js

@@ -10,7 +10,8 @@ 'use strict';

var throttle = _interopDefault(require('lodash/throttle'));
var forma36ReactComponents = require('@contentful/forma-36-react-components');
var tokens = _interopDefault(require('@contentful/forma-36-tokens'));
var f36Note = require('@contentful/f36-note');
var tokens = _interopDefault(require('@contentful/f36-tokens'));
var emotion = require('emotion');
var isNumber = _interopDefault(require('lodash/isNumber'));
var ReactDOM = _interopDefault(require('react-dom'));
var f36Components = require('@contentful/f36-components');
var get = _interopDefault(require('lodash/get'));

@@ -954,4 +955,4 @@ var isObject = _interopDefault(require('lodash/isObject'));

function PredefinedValuesError() {
return React.createElement(forma36ReactComponents.Note, {
noteType: "warning",
return React.createElement(f36Note.Note, {
variant: "warning",
testId: "predefined-values-warning"

@@ -1026,3 +1027,5 @@ }, "The widget failed to initialize. You can fix the problem by providing predefined values under the validations tab in the field settings.");

});
render(currentConfig);
render(currentConfig); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
resolve.apply(void 0, arguments);

@@ -1046,3 +1049,3 @@ getRoot().remove();

return React.createElement(forma36ReactComponents.Modal, {
return React.createElement(f36Components.Modal, {
key: key,

@@ -1057,3 +1060,3 @@ shouldCloseOnOverlayClick: options.shouldCloseOnOverlayClick || false,

}, function () {
return React.createElement(React.Fragment, null, options.title && React.createElement(forma36ReactComponents.Modal.Header, {
return React.createElement(React.Fragment, null, options.title && React.createElement(f36Components.ModalHeader, {
testId: "dialog-title",

@@ -1060,0 +1063,0 @@ title: options.title,

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

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=e(require("lodash/isEqual")),n=e(require("lodash/throttle")),o=require("@contentful/forma-36-react-components"),i=e(require("@contentful/forma-36-tokens")),a=require("emotion"),u=e(require("lodash/isNumber")),l=e(require("react-dom")),c=e(require("lodash/get")),s=e(require("lodash/isObject")),f=e(require("lodash/isString"));function d(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){return void r(e)}u.done?t(l):Promise.resolve(l).then(n,o)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){d(i,n,o,a,u,"next",e)}function u(e){d(i,n,o,a,u,"throw",e)}a(void 0)}))}}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return e(t={exports:{}},t.exports),t.exports}var m=y((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=Object.create((t&&t.prototype instanceof f?t:f).prototype),i=new C(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=c(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var s={};function f(){}function d(){}function p(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(L([])));y&&y!==t&&r.call(y,o)&&(h=y);var m=p.prototype=f.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,u){var l=c(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,u)}))}u(l.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,s;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return d.prototype=m.constructor=p,p.constructor=d,d.displayName=u(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),u(m,a,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),g=function(e){var t,r;function o(t){var r;(r=e.call(this,t)||this).unsubscribeErrors=null,r.unsubscribeDisabled=null,r.unsubscribeValue=null,r.setValue=function(){var e=p(m.mark((function e(t){return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.props.isEmptyValue(null!=t?t:null)?r.setState({value:void 0}):r.setState({value:t}),e.next=3,r.triggerSetValueCallbacks(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.triggerSetValueCallbacks=n((function(e){return new Promise((function(t,n){r.props.isEmptyValue(null!=e?e:null)?r.props.field.removeValue().then(t).catch(n):r.props.field.setValue(e).then(t).catch(n)}))}),r.props.throttle,{leading:0===r.props.throttle});var o=t.field.getValue();return r.state={isLocalValueChange:!1,externalReset:0,value:o,lastRemoteValue:o,disabled:t.isInitiallyDisabled,errors:[]},r}r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,v(t,r);var i=o.prototype;return i.componentDidMount=function(){var e=this,t=this.props.field;this.unsubscribeErrors=t.onSchemaErrorsChanged((function(t){e.setState({errors:t||[]})})),this.unsubscribeDisabled=t.onIsDisabledChanged((function(t){e.setState({disabled:t})})),this.unsubscribeValue=t.onValueChanged((function(t){e.setState((function(r){var n=e.props.isEqualValues(t,r.value);return{value:t,lastRemoteValue:n?r.lastRemoteValue:t,isLocalValueChange:n,externalReset:r.externalReset+(n?0:1)}}))}))},i.componentWillUnmount=function(){"function"==typeof this.unsubscribeErrors&&this.unsubscribeErrors(),"function"==typeof this.unsubscribeDisabled&&this.unsubscribeDisabled(),"function"==typeof this.unsubscribeValue&&this.unsubscribeValue()},i.render=function(){return this.props.children(h({},this.state,{setValue:this.setValue}))},o}(t.Component);g.defaultProps={children:function(){return null},isEmptyValue:function(e){return null===e||""===e},isEqualValues:function(e,t){return r(e,t)},throttle:300};var b=a.css({color:i.red600});function x(e){var t=null,r=function(){return null===t&&((t=document.createElement("div")).setAttribute("id","field-editor-modal-root"),document.body.appendChild(t)),t};return new Promise((function(t){var n={onClose:function(){o(n=h({},n,{isShown:!1})),t.apply(void 0,arguments),r().remove()},isShown:!0};function o(t){l.render(e({onClose:t.onClose,isShown:t.isShown}),r())}o(n)}))}function w(e,r){var n=Date.now(),i=u(e.width)?e.width+"px":e.width;return x((function(a){var u=a.onClose,l=function(){return u()};return t.createElement(o.Modal,{key:n,shouldCloseOnOverlayClick:e.shouldCloseOnOverlayClick||!1,shouldCloseOnEscapePress:e.shouldCloseOnEscapePress||!1,allowHeightOverflow:e.allowHeightOverflow||!1,position:e.position||"center",isShown:a.isShown,onClose:l,size:i||"700px"},(function(){return t.createElement(t.Fragment,null,e.title&&t.createElement(o.Modal.Header,{testId:"dialog-title",title:e.title,onClose:l}),t.createElement("div",{style:{minHeight:e.minHeight||"auto"}},t.createElement(r,{onClose:u})))}))}))}var E={__proto__:null,open:x,openDialog:w,default:{openDialog:w}};function C(e,t){if(!f(e))return t;if(e){var r=e.trim();return 0===r.length?t:r}return t}function L(e){var t=e.localeCode,r=e.defaultLocaleCode,n=c(e.entity,["fields",e.fieldId]);if(s(n)){var o=Object.keys(n)[0];return n[t]||n[r]||n[o]}}var O=function(e){return"Link"===e.type&&"Asset"===e.linkType};function _(e){return e.field.id===e.contentType.displayField}function V(e){var t=e.field,r=e.contentType;return function(e){return["Symbol","Text"].includes(e.type)}(t)&&!_({field:t,contentType:r})&&!function(e){return/\bslug\b/.test(e.name)}(t)}var S={__proto__:null,getFieldValue:L,getAssetTitle:function(e){var t=e.defaultTitle;return C(L({entity:e.asset,fieldId:"title",localeCode:e.localeCode,defaultLocaleCode:e.defaultLocaleCode}),t)},isAssetField:O,isDisplayField:_,isDescriptionField:V,getEntityDescription:function(e){var t=e.entity,r=e.contentType,n=e.localeCode,o=e.defaultLocaleCode;if(!r)return"";var i=r.fields.find((function(e){return V({field:e,contentType:r})}));return i&&L({entity:t,fieldId:i.id,localeCode:n,defaultLocaleCode:o})||""},getEntryTitle:function(e){var t,r=e.entry,n=e.contentType,o=e.localeCode,i=e.defaultLocaleCode,a=e.defaultTitle;if(!n)return a;var u=n.displayField;if(!u)return a;var l=n.fields.find((function(e){return e.id===u}));return l?(l.localized?(t=L({entity:r,fieldId:u,localeCode:o,defaultLocaleCode:i}))||(t=L({entity:r,fieldId:l.id,localeCode:o,defaultLocaleCode:i})):(t=L({entity:r,fieldId:u,defaultLocaleCode:i,localeCode:""}))||(t=L({entity:r,fieldId:l.id,defaultLocaleCode:i,localeCode:""})),C(t,a)):a},getEntryStatus:function(e){if(!e||"Entry"!==e.type&&"Asset"!==e.type)throw new TypeError("Invalid entity metadata object");return e.deletedVersion?"deleted":e.archivedVersion?"archived":e.publishedVersion?e.version>e.publishedVersion+1?"changed":"published":"draft"},getEntryImage:function(){var e=p(m.mark((function e(t,r){var n,o,i,a,u,l,s;return m.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.entry,i=t.localeCode,o=t.contentType){e.next=3;break}return e.abrupt("return",null);case 3:if(a=o.fields.find(O)){e.next=6;break}return e.abrupt("return",null);case 6:if(u=c(n.fields,[a.id,i,"sys","id"])){e.next=9;break}return e.abrupt("return",null);case 9:return e.prev=9,e.next=12,r(u);case 12:return l=c(e.sent,["fields","file",i]),s=Boolean(c(l,["details","image"],!1)),e.abrupt("return",s?l:null);case 18:return e.prev=18,e.t0=e.catch(9),e.abrupt("return",null);case 21:case"end":return e.stop()}}),e,null,[[9,18]])})));return function(t,r){return e.apply(this,arguments)}}()},k={__proto__:null,fromFieldValidations:function(e,t){void 0===e&&(e=[]);var r=e.find((function(e){return"size"in e})),n=r&&r.size||{},o=n.min,i=n.max;return u(o)&&u(i)?{type:"min-max",min:o,max:i}:u(o)?{type:"min",min:o}:u(i)?{type:"max",max:i}:{type:"max",max:"Symbol"===t?256:5e4}},makeChecker:function(e){return function(t){return"max"===e.type?t<=e.max:"min"===e.type?t>=e.min:t>=e.min&&t<=e.max}}};exports.CharCounter=function(e){var r,n=0;e.value&&(n=e.value.length);var o=0===n||e.checkConstraint(n);return t.createElement("span",{"data-status-code":o?null:"invalid-size",className:a.cx((r={},r[b]=!o,r))},n," characters")},exports.CharValidation=function(e){var r=e.constraints;return"max"===r.type?t.createElement("span",null,"Maximum ",r.max," characters"):"min"===r.type?t.createElement("span",null,"Requires at least ",r.min," characters"):t.createElement("span",null,"Requires between ",r.min," and ",r.max," characters")},exports.ConstraintsUtils=k,exports.FieldConnector=g,exports.ModalDialogLauncher=E,exports.PredefinedValuesError=function(){return t.createElement(o.Note,{noteType:"warning",testId:"predefined-values-warning"},"The widget failed to initialize. You can fix the problem by providing predefined values under the validations tab in the field settings.")},exports.entityHelpers=S,exports.isValidImage=function(e){return["image/bmp","image/x-windows-bmp","image/gif","image/webp","image/jpg","image/jpeg","image/pjpeg","image/x-jps","image/png","image/svg+xml"].includes(e.contentType)},exports.shortenStorageUnit=function(e,t){if(e<=0)return"0 B";var r=["PB","TB","GB","MB","KB","B"],n=function e(t,n){return t<.99&&!function(e){return r.indexOf(e)===r.length-1}(n)?e(1e3*t,function(e){return r[r.indexOf(e)+1]}(n)):t>=1e3&&!function(e){return 0===r.indexOf(e)}(n)?e(t/1e3,function(e){return r[r.indexOf(e)-1]}(n)):{number:t,unit:n}}(e,t),o=n.unit;return function(e,t){return e.toFixed(2).replace(/\.(0)*$|0*$/,"")}(n.number)+" "+o},exports.toLocaleString=function(e){return e.toLocaleString("en-US")};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=e(require("lodash/isEqual")),n=e(require("lodash/throttle")),o=require("@contentful/f36-note"),i=e(require("@contentful/f36-tokens")),a=require("emotion"),u=e(require("lodash/isNumber")),l=e(require("react-dom")),c=require("@contentful/f36-components"),s=e(require("lodash/get")),f=e(require("lodash/isObject")),d=e(require("lodash/isString"));function p(e,t,r,n,o,i,a){try{var u=e[i](a),l=u.value}catch(e){return void r(e)}u.done?t(l):Promise.resolve(l).then(n,o)}function h(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){p(i,n,o,a,u,"next",e)}function u(e){p(i,n,o,a,u,"throw",e)}a(void 0)}))}}function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return e(t={exports:{}},t.exports),t.exports}var g=m((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=Object.create((t&&t.prototype instanceof f?t:f).prototype),i=new C(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=x(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=c(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===s)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,i),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var s={};function f(){}function d(){}function p(){}var h={};h[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(L([])));y&&y!==t&&r.call(y,o)&&(h=y);var m=p.prototype=f.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,u){var l=c(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,u)}))}u(l.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return s;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,s;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,s):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,s)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return d.prototype=m.constructor=p,p.constructor=d,d.displayName=u(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},g(b.prototype),b.prototype[i]=function(){return this},e.AsyncIterator=b,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},g(m),u(m,a,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=L,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),s},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),s}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}})),b=function(e){var t,r;function o(t){var r;(r=e.call(this,t)||this).unsubscribeErrors=null,r.unsubscribeDisabled=null,r.unsubscribeValue=null,r.setValue=function(){var e=h(g.mark((function e(t){return g.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.props.isEmptyValue(null!=t?t:null)?r.setState({value:void 0}):r.setState({value:t}),e.next=3,r.triggerSetValueCallbacks(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.triggerSetValueCallbacks=n((function(e){return new Promise((function(t,n){r.props.isEmptyValue(null!=e?e:null)?r.props.field.removeValue().then(t).catch(n):r.props.field.setValue(e).then(t).catch(n)}))}),r.props.throttle,{leading:0===r.props.throttle});var o=t.field.getValue();return r.state={isLocalValueChange:!1,externalReset:0,value:o,lastRemoteValue:o,disabled:t.isInitiallyDisabled,errors:[]},r}r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,y(t,r);var i=o.prototype;return i.componentDidMount=function(){var e=this,t=this.props.field;this.unsubscribeErrors=t.onSchemaErrorsChanged((function(t){e.setState({errors:t||[]})})),this.unsubscribeDisabled=t.onIsDisabledChanged((function(t){e.setState({disabled:t})})),this.unsubscribeValue=t.onValueChanged((function(t){e.setState((function(r){var n=e.props.isEqualValues(t,r.value);return{value:t,lastRemoteValue:n?r.lastRemoteValue:t,isLocalValueChange:n,externalReset:r.externalReset+(n?0:1)}}))}))},i.componentWillUnmount=function(){"function"==typeof this.unsubscribeErrors&&this.unsubscribeErrors(),"function"==typeof this.unsubscribeDisabled&&this.unsubscribeDisabled(),"function"==typeof this.unsubscribeValue&&this.unsubscribeValue()},i.render=function(){return this.props.children(v({},this.state,{setValue:this.setValue}))},o}(t.Component);b.defaultProps={children:function(){return null},isEmptyValue:function(e){return null===e||""===e},isEqualValues:function(e,t){return r(e,t)},throttle:300};var x=a.css({color:i.red600});function w(e){var t=null,r=function(){return null===t&&((t=document.createElement("div")).setAttribute("id","field-editor-modal-root"),document.body.appendChild(t)),t};return new Promise((function(t){var n={onClose:function(){o(n=v({},n,{isShown:!1})),t.apply(void 0,arguments),r().remove()},isShown:!0};function o(t){l.render(e({onClose:t.onClose,isShown:t.isShown}),r())}o(n)}))}function E(e,r){var n=Date.now(),o=u(e.width)?e.width+"px":e.width;return w((function(i){var a=i.onClose,u=function(){return a()};return t.createElement(c.Modal,{key:n,shouldCloseOnOverlayClick:e.shouldCloseOnOverlayClick||!1,shouldCloseOnEscapePress:e.shouldCloseOnEscapePress||!1,allowHeightOverflow:e.allowHeightOverflow||!1,position:e.position||"center",isShown:i.isShown,onClose:u,size:o||"700px"},(function(){return t.createElement(t.Fragment,null,e.title&&t.createElement(c.ModalHeader,{testId:"dialog-title",title:e.title,onClose:u}),t.createElement("div",{style:{minHeight:e.minHeight||"auto"}},t.createElement(r,{onClose:a})))}))}))}var C={__proto__:null,open:w,openDialog:E,default:{openDialog:E}};function L(e,t){if(!d(e))return t;if(e){var r=e.trim();return 0===r.length?t:r}return t}function O(e){var t=e.localeCode,r=e.defaultLocaleCode,n=s(e.entity,["fields",e.fieldId]);if(f(n)){var o=Object.keys(n)[0];return n[t]||n[r]||n[o]}}var _=function(e){return"Link"===e.type&&"Asset"===e.linkType};function V(e){return e.field.id===e.contentType.displayField}function S(e){var t=e.field,r=e.contentType;return function(e){return["Symbol","Text"].includes(e.type)}(t)&&!V({field:t,contentType:r})&&!function(e){return/\bslug\b/.test(e.name)}(t)}var k={__proto__:null,getFieldValue:O,getAssetTitle:function(e){var t=e.defaultTitle;return L(O({entity:e.asset,fieldId:"title",localeCode:e.localeCode,defaultLocaleCode:e.defaultLocaleCode}),t)},isAssetField:_,isDisplayField:V,isDescriptionField:S,getEntityDescription:function(e){var t=e.entity,r=e.contentType,n=e.localeCode,o=e.defaultLocaleCode;if(!r)return"";var i=r.fields.find((function(e){return S({field:e,contentType:r})}));return i&&O({entity:t,fieldId:i.id,localeCode:n,defaultLocaleCode:o})||""},getEntryTitle:function(e){var t,r=e.entry,n=e.contentType,o=e.localeCode,i=e.defaultLocaleCode,a=e.defaultTitle;if(!n)return a;var u=n.displayField;if(!u)return a;var l=n.fields.find((function(e){return e.id===u}));return l?(l.localized?(t=O({entity:r,fieldId:u,localeCode:o,defaultLocaleCode:i}))||(t=O({entity:r,fieldId:l.id,localeCode:o,defaultLocaleCode:i})):(t=O({entity:r,fieldId:u,defaultLocaleCode:i,localeCode:""}))||(t=O({entity:r,fieldId:l.id,defaultLocaleCode:i,localeCode:""})),L(t,a)):a},getEntryStatus:function(e){if(!e||"Entry"!==e.type&&"Asset"!==e.type)throw new TypeError("Invalid entity metadata object");return e.deletedVersion?"deleted":e.archivedVersion?"archived":e.publishedVersion?e.version>e.publishedVersion+1?"changed":"published":"draft"},getEntryImage:function(){var e=h(g.mark((function e(t,r){var n,o,i,a,u,l,c;return g.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.entry,i=t.localeCode,o=t.contentType){e.next=3;break}return e.abrupt("return",null);case 3:if(a=o.fields.find(_)){e.next=6;break}return e.abrupt("return",null);case 6:if(u=s(n.fields,[a.id,i,"sys","id"])){e.next=9;break}return e.abrupt("return",null);case 9:return e.prev=9,e.next=12,r(u);case 12:return l=s(e.sent,["fields","file",i]),c=Boolean(s(l,["details","image"],!1)),e.abrupt("return",c?l:null);case 18:return e.prev=18,e.t0=e.catch(9),e.abrupt("return",null);case 21:case"end":return e.stop()}}),e,null,[[9,18]])})));return function(t,r){return e.apply(this,arguments)}}()},j={__proto__:null,fromFieldValidations:function(e,t){void 0===e&&(e=[]);var r=e.find((function(e){return"size"in e})),n=r&&r.size||{},o=n.min,i=n.max;return u(o)&&u(i)?{type:"min-max",min:o,max:i}:u(o)?{type:"min",min:o}:u(i)?{type:"max",max:i}:{type:"max",max:"Symbol"===t?256:5e4}},makeChecker:function(e){return function(t){return"max"===e.type?t<=e.max:"min"===e.type?t>=e.min:t>=e.min&&t<=e.max}}};exports.CharCounter=function(e){var r,n=0;e.value&&(n=e.value.length);var o=0===n||e.checkConstraint(n);return t.createElement("span",{"data-status-code":o?null:"invalid-size",className:a.cx((r={},r[x]=!o,r))},n," characters")},exports.CharValidation=function(e){var r=e.constraints;return"max"===r.type?t.createElement("span",null,"Maximum ",r.max," characters"):"min"===r.type?t.createElement("span",null,"Requires at least ",r.min," characters"):t.createElement("span",null,"Requires between ",r.min," and ",r.max," characters")},exports.ConstraintsUtils=j,exports.FieldConnector=b,exports.ModalDialogLauncher=C,exports.PredefinedValuesError=function(){return t.createElement(o.Note,{variant:"warning",testId:"predefined-values-warning"},"The widget failed to initialize. You can fix the problem by providing predefined values under the validations tab in the field settings.")},exports.entityHelpers=k,exports.isValidImage=function(e){return["image/bmp","image/x-windows-bmp","image/gif","image/webp","image/jpg","image/jpeg","image/pjpeg","image/x-jps","image/png","image/svg+xml"].includes(e.contentType)},exports.shortenStorageUnit=function(e,t){if(e<=0)return"0 B";var r=["PB","TB","GB","MB","KB","B"],n=function e(t,n){return t<.99&&!function(e){return r.indexOf(e)===r.length-1}(n)?e(1e3*t,function(e){return r[r.indexOf(e)+1]}(n)):t>=1e3&&!function(e){return 0===r.indexOf(e)}(n)?e(t/1e3,function(e){return r[r.indexOf(e)-1]}(n)):{number:t,unit:n}}(e,t),o=n.unit;return function(e,t){return e.toFixed(2).replace(/\.(0)*$|0*$/,"")}(n.number)+" "+o},exports.toLocaleString=function(e){return e.toLocaleString("en-US")};
//# sourceMappingURL=field-editor-shared.cjs.production.min.js.map
import React from 'react';
import isEqual from 'lodash-es/isEqual';
import throttle from 'lodash-es/throttle';
import { Note, Modal } from '@contentful/forma-36-react-components';
import tokens from '@contentful/forma-36-tokens';
import { Note } from '@contentful/f36-note';
import tokens from '@contentful/f36-tokens';
import { cx, css } from 'emotion';
import isNumber from 'lodash-es/isNumber';
import ReactDOM from 'react-dom';
import { Modal, ModalHeader } from '@contentful/f36-components';
import get from 'lodash-es/get';

@@ -948,3 +949,3 @@ import isObject from 'lodash-es/isObject';

return React.createElement(Note, {
noteType: "warning",
variant: "warning",
testId: "predefined-values-warning"

@@ -1019,3 +1020,5 @@ }, "The widget failed to initialize. You can fix the problem by providing predefined values under the validations tab in the field settings.");

});
render(currentConfig);
render(currentConfig); // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
resolve.apply(void 0, arguments);

@@ -1049,3 +1052,3 @@ getRoot().remove();

}, function () {
return React.createElement(React.Fragment, null, options.title && React.createElement(Modal.Header, {
return React.createElement(React.Fragment, null, options.title && React.createElement(ModalHeader, {
testId: "dialog-title",

@@ -1052,0 +1055,0 @@ title: options.title,

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

export { BaseExtensionSDK, ContentType, ContentTypeField, Link, Entry, Asset } from '@contentful/app-sdk';
export { BaseExtensionSDK, ContentType, ContentTypeField, Link, Entry, Asset, } from '@contentful/app-sdk';
export interface File {

@@ -3,0 +3,0 @@ fileName: string;

{
"name": "@contentful/field-editor-shared",
"version": "0.25.1",
"version": "0.26.0",
"main": "dist/index.js",

@@ -27,3 +27,4 @@ "module": "dist/field-editor-shared.esm.js",

"dependencies": {
"@contentful/forma-36-tokens": "^0.11.0",
"@contentful/f36-note": "beta",
"@contentful/f36-tokens": "beta",
"emotion": "^10.0.17",

@@ -42,3 +43,3 @@ "lodash": "^4.17.15",

},
"gitHead": "422234c47b3637970eea4501d095d2914c88b855"
"gitHead": "f86ba28db3f34cffc0dc2580bf21297542f331c9"
}

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

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