@contentful/field-editor-slug 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"field-editor-slug.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/TrackingFieldConnector.tsx","../src/services/slugify.ts","../src/services/makeSlug.ts","../src/styles.ts","../src/SlugEditorField.tsx","../src/SlugEditor.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","import React from 'react';\nimport { FieldExtensionSDK, FieldAPI } from '@contentful/app-sdk';\n\ntype Nullable = null | undefined;\n\ninterface TrackingFieldConnectorState<ValueType> {\n titleValue: ValueType | Nullable;\n isPublished: boolean;\n isSame: boolean;\n}\n\ninterface TrackingFieldConnectorProps<ValueType> {\n sdk: FieldExtensionSDK;\n field: FieldAPI;\n defaultLocale: string;\n trackingFieldId?: string;\n isOptionalLocaleWithFallback: boolean;\n children: (state: TrackingFieldConnectorState<ValueType>) => React.ReactNode;\n}\n\nfunction getTitleField(sdk: FieldExtensionSDK, trackingFieldId?: string) {\n const { entry, contentType } = sdk;\n if (trackingFieldId && entry.fields[trackingFieldId]) {\n return entry.fields[trackingFieldId];\n }\n return entry.fields[contentType.displayField];\n}\n\nexport class TrackingFieldConnector<ValueType> extends React.Component<\n TrackingFieldConnectorProps<ValueType>,\n TrackingFieldConnectorState<ValueType>\n> {\n static defaultProps = {\n children: () => {\n return null;\n },\n };\n\n constructor(props: TrackingFieldConnectorProps<ValueType>) {\n super(props);\n const titleField = getTitleField(props.sdk, props.trackingFieldId);\n const entrySys = props.sdk.entry.getSys();\n const isSame = titleField ? props.field.id === titleField.id : false;\n this.state = {\n titleValue: titleField ? titleField.getValue() : '',\n isPublished: Boolean(entrySys.publishedVersion),\n isSame,\n };\n }\n\n unsubscribeValue: Function | null = null;\n unsubscribeLocalizedValue: Function | null = null;\n unsubscribeSysChanges: Function | null = null;\n\n componentDidMount() {\n this.unsubscribeSysChanges = this.props.sdk.entry.onSysChanged((sys) => {\n this.setState({\n isPublished: Boolean(sys.publishedVersion),\n });\n });\n\n const titleField = getTitleField(this.props.sdk, this.props.trackingFieldId);\n\n // the content type's display field might not exist\n if (!titleField) {\n return;\n }\n\n if (!this.state.isSame) {\n this.unsubscribeLocalizedValue = titleField.onValueChanged(\n this.props.field.locale,\n (value: ValueType | Nullable) => {\n this.setState({ titleValue: value });\n }\n );\n }\n\n if (this.props.field.locale !== this.props.defaultLocale) {\n if (!this.props.isOptionalLocaleWithFallback) {\n this.unsubscribeValue = titleField.onValueChanged(\n this.props.defaultLocale,\n (value: ValueType | Nullable) => {\n if (!titleField.getValue(this.props.field.locale)) {\n this.setState({ titleValue: value });\n }\n }\n );\n }\n }\n }\n\n componentWillUnmount() {\n if (typeof this.unsubscribeValue === 'function') {\n this.unsubscribeValue();\n }\n if (typeof this.unsubscribeLocalizedValue === 'function') {\n this.unsubscribeLocalizedValue();\n }\n if (typeof this.unsubscribeSysChanges === 'function') {\n this.unsubscribeSysChanges();\n }\n }\n\n render() {\n return this.props.children({\n ...this.state,\n });\n }\n}\n","import getSlug from 'speakingurl';\n\nconst CF_GENERATED_SLUG_MAX_LENGTH = 75;\n\nconst languages = [\n 'ar',\n 'az',\n 'cs',\n 'de',\n 'dv',\n 'en',\n 'es',\n 'fa',\n 'fi',\n 'fr',\n 'ge',\n 'gr',\n 'hu',\n 'it',\n 'lt',\n 'lv',\n 'my',\n 'mk',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'ru',\n 'sk',\n 'sr',\n 'tr',\n 'uk',\n 'vn',\n];\n\n/**\n * Extracts the first two lowercased characters from the locale,\n * and returns the supported language prefix.\n */\nfunction supportedLanguage(locale: string) {\n const prefix = locale.slice(0, 2).toLowerCase();\n return languages[languages.indexOf(prefix)];\n}\n\n/**\n * Returns the slug for a given string and locale.\n * If the locale belongs to a language supported by SpeakingURL, it\n * is used as the symbol language. Otherwise, the symbol language\n * is english.\n * Slug suggestions are limited to 75 characters.\n *\n * @param {string} text To be turned into a slug.\n * @param {string?} locale\n * @returns {string} Slug for provided text.\n */\nexport function slugify(text: string, locale = 'en') {\n return getSlug(text, {\n separator: '-',\n lang: supportedLanguage(locale) || 'en',\n truncate: CF_GENERATED_SLUG_MAX_LENGTH + 1,\n custom: {\n \"'\": '',\n '`': '',\n '’': '',\n '‘': '',\n },\n });\n}\n","import { slugify } from './slugify';\n\ntype MakeSlugOptions = {\n locale: string;\n isOptionalLocaleWithFallback: boolean;\n createdAt: string;\n};\n\nfunction formatTwoDigit(num: number) {\n const asString = String(num);\n return asString.length === 1 ? `0${asString}` : asString;\n}\n\nexport function formatUtcDate(date: Date) {\n const year = date.getFullYear();\n const month = formatTwoDigit(date.getUTCMonth() + 1);\n const day = formatTwoDigit(date.getUTCDate());\n const hour = formatTwoDigit(date.getUTCHours());\n const minutes = formatTwoDigit(date.getUTCMinutes());\n const seconds = formatTwoDigit(date.getUTCSeconds());\n\n return `${year} ${month} ${day} at ${hour} ${minutes} ${seconds}`;\n}\n\nfunction untitledSlug({ isOptionalLocaleWithFallback, createdAt }: MakeSlugOptions) {\n if (isOptionalLocaleWithFallback) {\n return ''; // Will result in `undefined` slug.\n }\n\n const createdAtFormatted = formatUtcDate(new Date(createdAt));\n return slugify('Untitled entry ' + createdAtFormatted, 'en-US');\n}\n\nexport function makeSlug(title: string | null | undefined, options: MakeSlugOptions) {\n return title ? slugify(title, options.locale) : untitledSlug(options);\n}\n","import tokens from '@contentful/f36-tokens';\nimport { css } from 'emotion';\n\nexport const validationRow = css({\n display: 'flex',\n flexDirection: 'row-reverse',\n fontSize: tokens.fontSizeM,\n marginTop: tokens.spacingXs,\n color: tokens.gray700,\n});\n\nexport const inputContainer = css({\n position: 'relative',\n});\n\nexport const input = css({\n paddingLeft: '40px',\n});\n\nexport const icon = css({\n position: 'absolute',\n left: '10px',\n top: '8px',\n zIndex: 2,\n width: '25px',\n height: '25px',\n fill: tokens.gray500,\n});\n\nexport const spinnerContainer = css({\n position: 'absolute',\n zIndex: 2,\n right: '8px',\n top: '8px',\n});\n\nexport const uniqueValidationError = css({\n marginTop: tokens.spacingS,\n});\n","import React from 'react';\nimport { useDebounce } from 'use-debounce';\nimport { makeSlug } from './services/makeSlug';\nimport * as styles from './styles';\n\nimport { Spinner, ValidationMessage, TextInput } from '@contentful/f36-components';\n\nimport { LinkIcon } from '@contentful/f36-icons';\n\ninterface SlugEditorFieldProps {\n hasError: boolean;\n isOptionalLocaleWithFallback: boolean;\n isDisabled: boolean;\n value: string | null | undefined;\n locale: string;\n titleValue: string | null | undefined;\n createdAt: string;\n setValue: (value: string | null | undefined) => void;\n performUniqueCheck: (value: string) => Promise<boolean>;\n}\n\ntype CheckerState = 'checking' | 'unique' | 'duplicate';\n\nfunction useSlugUpdater(props: SlugEditorFieldProps, check: boolean) {\n const { value, setValue, createdAt, locale, titleValue, isOptionalLocaleWithFallback } = props;\n\n React.useEffect(() => {\n if (check === false) {\n return;\n }\n const newSlug = makeSlug(titleValue, {\n isOptionalLocaleWithFallback,\n locale,\n createdAt,\n });\n if (newSlug !== value) {\n setValue(newSlug);\n }\n }, [value, titleValue, isOptionalLocaleWithFallback, check, createdAt, locale, setValue]);\n}\n\nfunction useUniqueChecker(props: SlugEditorFieldProps) {\n const { performUniqueCheck } = props;\n const [status, setStatus] = React.useState<CheckerState>(props.value ? 'checking' : 'unique');\n const [debouncedValue] = useDebounce(props.value, 1000);\n\n /**\n * Check the uniqueness of the slug in the current space.\n * The slug is unique if there is no published entry other than the\n * current one, with the same slug.\n */\n React.useEffect(() => {\n if (!debouncedValue) {\n setStatus('unique');\n return;\n }\n setStatus('checking');\n performUniqueCheck(debouncedValue)\n .then((unique) => {\n setStatus(unique ? 'unique' : 'duplicate');\n })\n .catch(() => {\n setStatus('checking');\n });\n }, [debouncedValue, performUniqueCheck]);\n\n return status;\n}\n\nexport function SlugEditorFieldStatic(\n props: SlugEditorFieldProps & { onChange?: Function; onBlur?: Function }\n) {\n const { hasError, isDisabled, value, setValue, onChange, onBlur } = props;\n\n const status = useUniqueChecker(props);\n\n return (\n <div className={styles.inputContainer}>\n <LinkIcon className={styles.icon} />\n <TextInput\n className={styles.input}\n isInvalid={hasError || status === 'duplicate'}\n isDisabled={isDisabled}\n value={value || ''}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n if (onChange) {\n onChange();\n }\n }}\n onBlur={() => {\n if (onBlur) {\n onBlur();\n }\n }}\n />\n {status === 'checking' && (\n <div className={styles.spinnerContainer}>\n <Spinner testId=\"slug-editor-spinner\" />\n </div>\n )}\n {status === 'duplicate' && (\n <ValidationMessage\n testId=\"slug-editor-duplicate-error\"\n className={styles.uniqueValidationError}>\n This slug has already been published in another entry\n </ValidationMessage>\n )}\n </div>\n );\n}\n\nexport function SlugEditorField(props: SlugEditorFieldProps) {\n const { titleValue, isOptionalLocaleWithFallback, locale, createdAt, value } = props;\n\n const areEqual = React.useCallback(() => {\n const potentialSlug = makeSlug(titleValue, {\n isOptionalLocaleWithFallback: isOptionalLocaleWithFallback,\n locale: locale,\n createdAt: createdAt,\n });\n return value === potentialSlug;\n }, [titleValue, isOptionalLocaleWithFallback, locale, createdAt, value]);\n\n const [check, setCheck] = React.useState<boolean>(() => {\n if (props.value) {\n if (!props.titleValue) {\n return false;\n }\n return areEqual();\n }\n return true;\n });\n\n React.useEffect(() => {\n if (areEqual()) {\n setCheck(true);\n }\n }, [props.titleValue, areEqual]);\n\n useSlugUpdater(props, check);\n\n return (\n <SlugEditorFieldStatic\n {...props}\n onChange={() => {\n setCheck(false);\n }}\n onBlur={() => {\n if (areEqual()) {\n setCheck(true);\n }\n }}\n />\n );\n}\n","import * as React from 'react';\nimport { FieldExtensionSDK, FieldAPI, ValidationError } from '@contentful/app-sdk';\nimport { FieldConnector } from '@contentful/field-editor-shared';\nimport { TrackingFieldConnector } from './TrackingFieldConnector';\nimport { SlugEditorField, SlugEditorFieldStatic } from './SlugEditorField';\n\nexport interface SlugEditorProps {\n /**\n * is the field disabled initially\n */\n isInitiallyDisabled: boolean;\n\n baseSdk: FieldExtensionSDK;\n\n /**\n * sdk.field\n */\n field: FieldAPI;\n\n parameters?: {\n instance: {\n trackingFieldId?: string;\n };\n };\n}\n\nfunction isSupportedFieldTypes(val: string): val is 'Symbol' {\n return val === 'Symbol';\n}\n\nfunction FieldConnectorCallback({\n Component,\n value,\n disabled,\n setValue,\n errors,\n titleValue,\n isOptionalLocaleWithFallback,\n locale,\n createdAt,\n performUniqueCheck,\n}: {\n Component: typeof SlugEditorFieldStatic | typeof SlugEditorField;\n value: string | null | undefined;\n disabled: boolean;\n titleValue: string | null | undefined;\n setValue: (value: string | null | undefined) => Promise<unknown>;\n errors: ValidationError[];\n isOptionalLocaleWithFallback: boolean;\n locale: FieldAPI['locale'];\n createdAt: string;\n performUniqueCheck: (value: string) => Promise<boolean>;\n}) {\n // it is needed to silent permission errors\n // this happens when setValue is called on a field which is disabled for permission reasons\n const safeSetValue = React.useCallback(\n async (...args: Parameters<typeof setValue>) => {\n try {\n await setValue(...args);\n } catch (e) {\n // do nothing\n }\n },\n [setValue]\n );\n\n return (\n <div data-test-id=\"slug-editor\">\n <Component\n locale={locale}\n createdAt={createdAt}\n performUniqueCheck={performUniqueCheck}\n hasError={errors.length > 0}\n value={value}\n isOptionalLocaleWithFallback={isOptionalLocaleWithFallback}\n isDisabled={disabled}\n titleValue={titleValue}\n setValue={safeSetValue}\n />\n </div>\n );\n}\n\nexport function SlugEditor(props: SlugEditorProps) {\n const { field, parameters } = props;\n const { locales, entry, space } = props.baseSdk;\n\n if (!isSupportedFieldTypes(field.type)) {\n throw new Error(`\"${field.type}\" field type is not supported by SlugEditor`);\n }\n\n const trackingFieldId = parameters?.instance?.trackingFieldId ?? undefined;\n const entrySys = entry.getSys();\n\n const isLocaleOptional = locales.optional[field.locale];\n const localeFallbackCode = locales.fallbacks[field.locale];\n\n // If the field or the locale are not required (there's a locale setting that\n // allows publishing even if the field is required) and if the locale has a\n // fallback than there's no need for a slug unless the user manually enters\n // one or the title field is also localized with a custom value.\n const isOptionalFieldLocale = Boolean(!field.required || isLocaleOptional);\n const isOptionalLocaleWithFallback = Boolean(\n isOptionalFieldLocale && localeFallbackCode && locales.available.includes(localeFallbackCode)\n );\n\n const performUniqueCheck = React.useCallback(\n (value: string) => {\n const searchQuery = {\n content_type: entrySys?.contentType?.sys?.id,\n [`fields.${field.id}.${field.locale}`]: value,\n 'sys.id[ne]': entrySys.id,\n 'sys.publishedAt[exists]': true,\n limit: 0,\n };\n return space.getEntries(searchQuery).then((res) => {\n return res.total === 0;\n });\n },\n [entrySys?.contentType?.sys?.id, field.id, field.locale, entrySys.id, space]\n );\n\n return (\n <TrackingFieldConnector<string>\n sdk={props.baseSdk}\n field={field}\n defaultLocale={locales.default}\n isOptionalLocaleWithFallback={isOptionalLocaleWithFallback}\n trackingFieldId={trackingFieldId}>\n {({ titleValue, isPublished, isSame }) => (\n <FieldConnector<string>\n field={field}\n isInitiallyDisabled={props.isInitiallyDisabled}\n throttle={0}>\n {({ value, errors, disabled, setValue, externalReset }) => {\n const shouldTrackTitle = isPublished === false && isSame === false;\n\n const Component = shouldTrackTitle ? SlugEditorField : SlugEditorFieldStatic;\n\n return (\n <FieldConnectorCallback\n Component={Component}\n titleValue={titleValue}\n value={value}\n errors={errors}\n disabled={disabled}\n setValue={setValue}\n isOptionalLocaleWithFallback={isOptionalLocaleWithFallback}\n createdAt={entrySys.createdAt}\n locale={field.locale}\n performUniqueCheck={performUniqueCheck}\n key={`slug-editor-${externalReset}`}\n />\n );\n }}\n </FieldConnector>\n )}\n </TrackingFieldConnector>\n );\n}\n\nSlugEditor.defaultProps = {\n isInitiallyDisabled: true,\n};\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","constructor","displayName","isGeneratorFunction","genFun","ctor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","Function","getTitleField","sdk","trackingFieldId","fields","contentType","displayField","TrackingFieldConnector","props","titleField","entrySys","getSys","isSame","field","id","titleValue","getValue","isPublished","Boolean","publishedVersion","componentDidMount","unsubscribeSysChanges","onSysChanged","sys","_this2","setState","unsubscribeLocalizedValue","onValueChanged","locale","defaultLocale","isOptionalLocaleWithFallback","unsubscribeValue","componentWillUnmount","render","children","React","Component","languages","supportedLanguage","prefix","toLowerCase","indexOf","slugify","text","getSlug","separator","lang","truncate","CF_GENERATED_SLUG_MAX_LENGTH","custom","formatTwoDigit","num","asString","String","makeSlug","title","options","date","Date","createdAt","getFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","inputContainer","css","position","input","paddingLeft","icon","left","top","zIndex","width","height","fill","tokens","gray500","spinnerContainer","right","uniqueValidationError","marginTop","spacingS","SlugEditorFieldStatic","hasError","isDisabled","setValue","onChange","onBlur","status","performUniqueCheck","useState","setStatus","debouncedValue","useDebounce","useEffect","unique","useUniqueChecker","className","styles","LinkIcon","TextInput","isInvalid","e","target","Spinner","testId","ValidationMessage","SlugEditorField","areEqual","useCallback","potentialSlug","check","setCheck","newSlug","useSlugUpdater","FieldConnectorCallback","disabled","errors","safeSetValue","SlugEditor","parameters","baseSdk","locales","space","instance","_parameters$instance","localeFallbackCode","fallbacks","isOptionalFieldLocale","required","optional","available","includes","searchQuery","content_type","_entrySys$contentType","_entrySys$contentType2","limit","getEntries","res","total","_entrySys$contentType3","_entrySys$contentType4","FieldConnector","isInitiallyDisabled","throttle","externalReset","defaultProps"],"mappings":"+kCAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EAAMC,OAGhCC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,WAIzCC,EAAUK,iBAsMcT,EAASE,EAAMK,OACnCG,EA/KuB,wBAiLpB,SAAgBC,EAAQC,MA/KT,cAgLhBF,QACI,IAAIG,MAAM,mCAhLE,cAmLhBH,EAA6B,IAChB,UAAXC,QACIC,QAyQL,CAAEnB,WAzfPqB,EAyfyBC,MAAM,OAjQ/BR,EAAQI,OAASA,EACjBJ,EAAQK,IAAMA,IAED,KACPI,EAAWT,EAAQS,YACnBA,EAAU,KACRC,EAAiBC,EAAoBF,EAAUT,MAC/CU,EAAgB,IACdA,IAAmBE,EAA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sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/TrackingFieldConnector.tsx","../src/services/slugify.ts","../src/services/makeSlug.ts","../src/styles.ts","../src/SlugEditorField.tsx","../src/SlugEditor.tsx"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import React from 'react';\nimport { FieldExtensionSDK, FieldAPI } from '@contentful/app-sdk';\n\ntype Nullable = null | undefined;\n\ninterface TrackingFieldConnectorState<ValueType> {\n titleValue: ValueType | Nullable;\n isPublished: boolean;\n isSame: boolean;\n}\n\ninterface TrackingFieldConnectorProps<ValueType> {\n sdk: FieldExtensionSDK;\n field: FieldAPI;\n defaultLocale: string;\n trackingFieldId?: string;\n isOptionalLocaleWithFallback: boolean;\n children: (state: TrackingFieldConnectorState<ValueType>) => React.ReactNode;\n}\n\nfunction getTitleField(sdk: FieldExtensionSDK, trackingFieldId?: string) {\n const { entry, contentType } = sdk;\n if (trackingFieldId && entry.fields[trackingFieldId]) {\n return entry.fields[trackingFieldId];\n }\n return entry.fields[contentType.displayField];\n}\n\nexport class TrackingFieldConnector<ValueType> extends React.Component<\n TrackingFieldConnectorProps<ValueType>,\n TrackingFieldConnectorState<ValueType>\n> {\n static defaultProps = {\n children: () => {\n return null;\n },\n };\n\n constructor(props: TrackingFieldConnectorProps<ValueType>) {\n super(props);\n const titleField = getTitleField(props.sdk, props.trackingFieldId);\n const entrySys = props.sdk.entry.getSys();\n const isSame = titleField ? props.field.id === titleField.id : false;\n this.state = {\n titleValue: titleField ? titleField.getValue() : '',\n isPublished: Boolean(entrySys.publishedVersion),\n isSame,\n };\n }\n\n unsubscribeValue: Function | null = null;\n unsubscribeLocalizedValue: Function | null = null;\n unsubscribeSysChanges: Function | null = null;\n\n componentDidMount() {\n this.unsubscribeSysChanges = this.props.sdk.entry.onSysChanged((sys) => {\n this.setState({\n isPublished: Boolean(sys.publishedVersion),\n });\n });\n\n const titleField = getTitleField(this.props.sdk, this.props.trackingFieldId);\n\n // the content type's display field might not exist\n if (!titleField) {\n return;\n }\n\n if (!this.state.isSame) {\n this.unsubscribeLocalizedValue = titleField.onValueChanged(\n this.props.field.locale,\n (value: ValueType | Nullable) => {\n this.setState({ titleValue: value });\n }\n );\n }\n\n if (this.props.field.locale !== this.props.defaultLocale) {\n if (!this.props.isOptionalLocaleWithFallback) {\n this.unsubscribeValue = titleField.onValueChanged(\n this.props.defaultLocale,\n (value: ValueType | Nullable) => {\n if (!titleField.getValue(this.props.field.locale)) {\n this.setState({ titleValue: value });\n }\n }\n );\n }\n }\n }\n\n componentWillUnmount() {\n if (typeof this.unsubscribeValue === 'function') {\n this.unsubscribeValue();\n }\n if (typeof this.unsubscribeLocalizedValue === 'function') {\n this.unsubscribeLocalizedValue();\n }\n if (typeof this.unsubscribeSysChanges === 'function') {\n this.unsubscribeSysChanges();\n }\n }\n\n render() {\n return this.props.children({\n ...this.state,\n });\n }\n}\n","import getSlug from 'speakingurl';\n\nconst CF_GENERATED_SLUG_MAX_LENGTH = 75;\n\nconst languages = [\n 'ar',\n 'az',\n 'cs',\n 'de',\n 'dv',\n 'en',\n 'es',\n 'fa',\n 'fi',\n 'fr',\n 'ge',\n 'gr',\n 'hu',\n 'it',\n 'lt',\n 'lv',\n 'my',\n 'mk',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'ru',\n 'sk',\n 'sr',\n 'tr',\n 'uk',\n 'vn',\n];\n\n/**\n * Extracts the first two lowercased characters from the locale,\n * and returns the supported language prefix.\n */\nfunction supportedLanguage(locale: string) {\n const prefix = locale.slice(0, 2).toLowerCase();\n return languages[languages.indexOf(prefix)];\n}\n\n/**\n * Returns the slug for a given string and locale.\n * If the locale belongs to a language supported by SpeakingURL, it\n * is used as the symbol language. Otherwise, the symbol language\n * is english.\n * Slug suggestions are limited to 75 characters.\n *\n * @param {string} text To be turned into a slug.\n * @param {string?} locale\n * @returns {string} Slug for provided text.\n */\nexport function slugify(text: string, locale = 'en') {\n return getSlug(text, {\n separator: '-',\n lang: supportedLanguage(locale) || 'en',\n truncate: CF_GENERATED_SLUG_MAX_LENGTH + 1,\n custom: {\n \"'\": '',\n '`': '',\n '’': '',\n '‘': '',\n },\n });\n}\n","import { slugify } from './slugify';\n\ntype MakeSlugOptions = {\n locale: string;\n isOptionalLocaleWithFallback: boolean;\n createdAt: string;\n};\n\nfunction formatTwoDigit(num: number) {\n const asString = String(num);\n return asString.length === 1 ? `0${asString}` : asString;\n}\n\nexport function formatUtcDate(date: Date) {\n const year = date.getFullYear();\n const month = formatTwoDigit(date.getUTCMonth() + 1);\n const day = formatTwoDigit(date.getUTCDate());\n const hour = formatTwoDigit(date.getUTCHours());\n const minutes = formatTwoDigit(date.getUTCMinutes());\n const seconds = formatTwoDigit(date.getUTCSeconds());\n\n return `${year} ${month} ${day} at ${hour} ${minutes} ${seconds}`;\n}\n\nfunction untitledSlug({ isOptionalLocaleWithFallback, createdAt }: MakeSlugOptions) {\n if (isOptionalLocaleWithFallback) {\n return ''; // Will result in `undefined` slug.\n }\n\n const createdAtFormatted = formatUtcDate(new Date(createdAt));\n return slugify('Untitled entry ' + createdAtFormatted, 'en-US');\n}\n\nexport function makeSlug(title: string | null | undefined, options: MakeSlugOptions) {\n return title ? slugify(title, options.locale) : untitledSlug(options);\n}\n","import tokens from '@contentful/f36-tokens';\nimport { css } from 'emotion';\n\nexport const validationRow = css({\n display: 'flex',\n flexDirection: 'row-reverse',\n fontSize: tokens.fontSizeM,\n marginTop: tokens.spacingXs,\n color: tokens.gray700,\n});\n\nexport const inputContainer = css({\n position: 'relative',\n});\n\nexport const input = css({\n paddingLeft: '40px',\n});\n\nexport const icon = css({\n position: 'absolute',\n left: '10px',\n top: '8px',\n zIndex: 2,\n width: '25px',\n height: '25px',\n fill: tokens.gray500,\n});\n\nexport const spinnerContainer = css({\n position: 'absolute',\n zIndex: 2,\n right: '8px',\n top: '8px',\n});\n\nexport const uniqueValidationError = css({\n marginTop: tokens.spacingS,\n});\n","import React from 'react';\nimport { useDebounce } from 'use-debounce';\nimport { makeSlug } from './services/makeSlug';\nimport * as styles from './styles';\n\nimport { Spinner, ValidationMessage, TextInput } from '@contentful/f36-components';\n\nimport { LinkIcon } from '@contentful/f36-icons';\n\ninterface SlugEditorFieldProps {\n hasError: boolean;\n isOptionalLocaleWithFallback: boolean;\n isDisabled: boolean;\n value: string | null | undefined;\n locale: string;\n titleValue: string | null | undefined;\n createdAt: string;\n setValue: (value: string | null | undefined) => void;\n performUniqueCheck: (value: string) => Promise<boolean>;\n}\n\ntype CheckerState = 'checking' | 'unique' | 'duplicate';\n\nfunction useSlugUpdater(props: SlugEditorFieldProps, check: boolean) {\n const { value, setValue, createdAt, locale, titleValue, isOptionalLocaleWithFallback } = props;\n\n React.useEffect(() => {\n if (check === false) {\n return;\n }\n const newSlug = makeSlug(titleValue, {\n isOptionalLocaleWithFallback,\n locale,\n createdAt,\n });\n if (newSlug !== value) {\n setValue(newSlug);\n }\n }, [value, titleValue, isOptionalLocaleWithFallback, check, createdAt, locale, setValue]);\n}\n\nfunction useUniqueChecker(props: SlugEditorFieldProps) {\n const { performUniqueCheck } = props;\n const [status, setStatus] = React.useState<CheckerState>(props.value ? 'checking' : 'unique');\n const [debouncedValue] = useDebounce(props.value, 1000);\n\n /**\n * Check the uniqueness of the slug in the current space.\n * The slug is unique if there is no published entry other than the\n * current one, with the same slug.\n */\n React.useEffect(() => {\n if (!debouncedValue) {\n setStatus('unique');\n return;\n }\n setStatus('checking');\n performUniqueCheck(debouncedValue)\n .then((unique) => {\n setStatus(unique ? 'unique' : 'duplicate');\n })\n .catch(() => {\n setStatus('checking');\n });\n }, [debouncedValue, performUniqueCheck]);\n\n return status;\n}\n\nexport function SlugEditorFieldStatic(\n props: SlugEditorFieldProps & { onChange?: Function; onBlur?: Function }\n) {\n const { hasError, isDisabled, value, setValue, onChange, onBlur } = props;\n\n const status = useUniqueChecker(props);\n\n return (\n <div className={styles.inputContainer}>\n <LinkIcon className={styles.icon} />\n <TextInput\n className={styles.input}\n isInvalid={hasError || status === 'duplicate'}\n isDisabled={isDisabled}\n value={value || ''}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setValue(e.target.value);\n if (onChange) {\n onChange();\n }\n }}\n onBlur={() => {\n if (onBlur) {\n onBlur();\n }\n }}\n />\n {status === 'checking' && (\n <div className={styles.spinnerContainer}>\n <Spinner testId=\"slug-editor-spinner\" />\n </div>\n )}\n {status === 'duplicate' && (\n <ValidationMessage\n testId=\"slug-editor-duplicate-error\"\n className={styles.uniqueValidationError}>\n This slug has already been published in another entry\n </ValidationMessage>\n )}\n </div>\n );\n}\n\nexport function SlugEditorField(props: SlugEditorFieldProps) {\n const { titleValue, isOptionalLocaleWithFallback, locale, createdAt, value } = props;\n\n const areEqual = React.useCallback(() => {\n const potentialSlug = makeSlug(titleValue, {\n isOptionalLocaleWithFallback: isOptionalLocaleWithFallback,\n locale: locale,\n createdAt: createdAt,\n });\n return value === potentialSlug;\n }, [titleValue, isOptionalLocaleWithFallback, locale, createdAt, value]);\n\n const [check, setCheck] = React.useState<boolean>(() => {\n if (props.value) {\n if (!props.titleValue) {\n return false;\n }\n return areEqual();\n }\n return true;\n });\n\n React.useEffect(() => {\n if (areEqual()) {\n setCheck(true);\n }\n }, [props.titleValue, areEqual]);\n\n useSlugUpdater(props, check);\n\n return (\n <SlugEditorFieldStatic\n {...props}\n onChange={() => {\n setCheck(false);\n }}\n onBlur={() => {\n if (areEqual()) {\n setCheck(true);\n }\n }}\n />\n );\n}\n","import * as React from 'react';\nimport { FieldExtensionSDK, FieldAPI, ValidationError } from '@contentful/app-sdk';\nimport { FieldConnector } from '@contentful/field-editor-shared';\nimport { TrackingFieldConnector } from './TrackingFieldConnector';\nimport { SlugEditorField, SlugEditorFieldStatic } from './SlugEditorField';\n\nexport interface SlugEditorProps {\n /**\n * is the field disabled initially\n */\n isInitiallyDisabled: boolean;\n\n baseSdk: FieldExtensionSDK;\n\n /**\n * sdk.field\n */\n field: FieldAPI;\n\n parameters?: {\n instance: {\n trackingFieldId?: string;\n };\n };\n}\n\nfunction isSupportedFieldTypes(val: string): val is 'Symbol' {\n return val === 'Symbol';\n}\n\nfunction FieldConnectorCallback({\n Component,\n value,\n disabled,\n setValue,\n errors,\n titleValue,\n isOptionalLocaleWithFallback,\n locale,\n createdAt,\n performUniqueCheck,\n}: {\n Component: typeof SlugEditorFieldStatic | typeof SlugEditorField;\n value: string | null | undefined;\n disabled: boolean;\n titleValue: string | null | undefined;\n setValue: (value: string | null | undefined) => Promise<unknown>;\n errors: ValidationError[];\n isOptionalLocaleWithFallback: boolean;\n locale: FieldAPI['locale'];\n createdAt: string;\n performUniqueCheck: (value: string) => Promise<boolean>;\n}) {\n // it is needed to silent permission errors\n // this happens when setValue is called on a field which is disabled for permission reasons\n const safeSetValue = React.useCallback(\n async (...args: Parameters<typeof setValue>) => {\n try {\n await setValue(...args);\n } catch (e) {\n // do nothing\n }\n },\n [setValue]\n );\n\n return (\n <div data-test-id=\"slug-editor\">\n <Component\n locale={locale}\n createdAt={createdAt}\n performUniqueCheck={performUniqueCheck}\n hasError={errors.length > 0}\n value={value}\n isOptionalLocaleWithFallback={isOptionalLocaleWithFallback}\n isDisabled={disabled}\n titleValue={titleValue}\n setValue={safeSetValue}\n />\n </div>\n );\n}\n\nexport function SlugEditor(props: SlugEditorProps) {\n const { field, parameters } = props;\n const { locales, entry, space } = props.baseSdk;\n\n if (!isSupportedFieldTypes(field.type)) {\n throw new Error(`\"${field.type}\" field type is not supported by SlugEditor`);\n }\n\n const trackingFieldId = parameters?.instance?.trackingFieldId ?? undefined;\n const entrySys = entry.getSys();\n\n const isLocaleOptional = locales.optional[field.locale];\n const localeFallbackCode = locales.fallbacks[field.locale];\n\n // If the field or the locale are not required (there's a locale setting that\n // allows publishing even if the field is required) and if the locale has a\n // fallback than there's no need for a slug unless the user manually enters\n // one or the title field is also localized with a custom value.\n const isOptionalFieldLocale = Boolean(!field.required || isLocaleOptional);\n const isOptionalLocaleWithFallback = Boolean(\n isOptionalFieldLocale && localeFallbackCode && locales.available.includes(localeFallbackCode)\n );\n\n const performUniqueCheck = React.useCallback(\n (value: string) => {\n const searchQuery = {\n content_type: entrySys?.contentType?.sys?.id,\n [`fields.${field.id}.${field.locale}`]: value,\n 'sys.id[ne]': entrySys.id,\n 'sys.publishedAt[exists]': true,\n limit: 0,\n };\n return space.getEntries(searchQuery).then((res) => {\n return res.total === 0;\n });\n },\n [entrySys?.contentType?.sys?.id, field.id, field.locale, entrySys.id, space]\n );\n\n return (\n <TrackingFieldConnector<string>\n sdk={props.baseSdk}\n field={field}\n defaultLocale={locales.default}\n isOptionalLocaleWithFallback={isOptionalLocaleWithFallback}\n trackingFieldId={trackingFieldId}>\n {({ titleValue, isPublished, isSame }) => (\n <FieldConnector<string>\n field={field}\n isInitiallyDisabled={props.isInitiallyDisabled}\n throttle={0}>\n {({ value, errors, disabled, setValue, externalReset }) => {\n const shouldTrackTitle = isPublished === false && isSame === false;\n\n const Component = shouldTrackTitle ? SlugEditorField : SlugEditorFieldStatic;\n\n return (\n <FieldConnectorCallback\n Component={Component}\n titleValue={titleValue}\n value={value}\n errors={errors}\n disabled={disabled}\n setValue={setValue}\n isOptionalLocaleWithFallback={isOptionalLocaleWithFallback}\n createdAt={entrySys.createdAt}\n locale={field.locale}\n performUniqueCheck={performUniqueCheck}\n key={`slug-editor-${externalReset}`}\n />\n );\n }}\n </FieldConnector>\n )}\n </TrackingFieldConnector>\n );\n}\n\nSlugEditor.defaultProps = {\n isInitiallyDisabled: true,\n};\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","getTitleField","sdk","trackingFieldId","fields","contentType","displayField","TrackingFieldConnector","props","unsubscribeValue","unsubscribeLocalizedValue","unsubscribeSysChanges","titleField","entrySys","getSys","isSame","field","id","titleValue","getValue","isPublished","Boolean","publishedVersion","componentDidMount","onSysChanged","sys","_this2","setState","onValueChanged","locale","defaultLocale","isOptionalLocaleWithFallback","componentWillUnmount","render","children","React","Component","defaultProps","languages","supportedLanguage","prefix","toLowerCase","indexOf","slugify","text","getSlug","separator","lang","truncate","CF_GENERATED_SLUG_MAX_LENGTH","custom","formatTwoDigit","num","asString","String","makeSlug","title","options","date","Date","createdAt","getFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","inputContainer","css","position","input","paddingLeft","icon","left","top","zIndex","width","height","fill","tokens","gray500","spinnerContainer","right","uniqueValidationError","marginTop","spacingS","SlugEditorFieldStatic","hasError","isDisabled","setValue","onChange","onBlur","status","performUniqueCheck","useState","setStatus","debouncedValue","useDebounce","useEffect","unique","useUniqueChecker","className","styles","LinkIcon","TextInput","isInvalid","e","target","Spinner","testId","ValidationMessage","SlugEditorField","areEqual","useCallback","potentialSlug","check","setCheck","newSlug","useSlugUpdater","FieldConnectorCallback","disabled","errors","safeSetValue","SlugEditor","parameters","baseSdk","locales","space","instance","_parameters$instance","localeFallbackCode","fallbacks","isOptionalFieldLocale","required","optional","available","includes","searchQuery","content_type","_entrySys$contentType","_entrySys$contentType2","limit","getEntries","res","total","_entrySys$contentType3","_entrySys$contentType4","FieldConnector","isInitiallyDisabled","throttle","externalReset"],"mappings":"+kCAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EAAMC,OAGhCC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,WAIzCC,EAAUK,iBAuMcT,EAASE,EAAMK,OACnCG,EAhLuB,wBAkLpB,SAAgBC,EAAQC,MAhLT,cAiLhBF,QACI,IAAIG,MAAM,mCAjLE,cAoLhBH,EAA6B,IAChB,UAAXC,QACIC,QAyQL,CAAEnB,WA1fPqB,EA0fyBC,MAAM,OAjQ/BR,EAAQI,OAASA,EACjBJ,EAAQK,IAAMA,IAED,KACPI,EAAWT,EAAQS,YACnBA,EAAU,KACRC,EAAiBC,EAAoBF,EAAUT,MAC/CU,EAAgB,IACdA,IAAmBE,EAAkB,gBAClCF,MAIY,SAAnBV,EAAQI,OAGV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iCiR,sBA2BjD3B,EAAWtF,aAAe,CACxB+G,qBAAqB"}
@@ -174,11 +174,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
174
174
 
175
175
 
176
176
  var IteratorPrototype = {};
177
-
178
- IteratorPrototype[iteratorSymbol] = function () {
177
+ define(IteratorPrototype, iteratorSymbol, function () {
179
178
  return this;
180
- };
181
-
179
+ });
182
180
  var getProto = Object.getPrototypeOf;
183
181
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
184
182
 
@@ -189,8 +187,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
189
187
  }
190
188
 
191
189
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
192
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
193
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
190
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
191
+ define(Gp, "constructor", GeneratorFunctionPrototype);
192
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
194
193
  GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
195
194
  // Iterator interface in terms of a single ._invoke method.
196
195
 
@@ -295,11 +294,9 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
295
294
  }
296
295
 
297
296
  defineIteratorMethods(AsyncIterator.prototype);
298
-
299
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
297
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
300
298
  return this;
301
- };
302
-
299
+ });
303
300
  exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
304
301
  // AsyncIterator objects; they just return a Promise for the value of
305
302
  // the final result produced by the iterator.
@@ -476,13 +473,12 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
476
473
  // object to not be returned from this call. This ensures that doesn't happen.
477
474
  // See https://github.com/facebook/regenerator/issues/274 for more details.
478
475
 
479
- Gp[iteratorSymbol] = function () {
476
+ define(Gp, iteratorSymbol, function () {
480
477
  return this;
481
- };
482
-
483
- Gp.toString = function () {
478
+ });
479
+ define(Gp, "toString", function () {
484
480
  return "[object Generator]";
485
- };
481
+ });
486
482
 
487
483
  function pushTryEntry(locs) {
488
484
  var entry = {
@@ -794,14 +790,19 @@ var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
794
790
  } catch (accidentalStrictMode) {
795
791
  // This module should not be running in strict mode, so the above
796
792
  // assignment should always work unless something is misconfigured. Just
797
- // in case runtime.js accidentally runs in strict mode, we can escape
793
+ // in case runtime.js accidentally runs in strict mode, in modern engines
794
+ // we can explicitly access globalThis. In older engines we can escape
798
795
  // strict mode using a global Function call. This could conceivably fail
799
796
  // if a Content Security Policy forbids using Function, but in that case
800
797
  // the proper solution is to fix the accidental strict mode problem. If
801
798
  // you've misconfigured your bundler to force strict mode and applied a
802
799
  // CSP to forbid Function, and you're not willing to fix either of those
803
800
  // problems, please detail your unique predicament in a GitHub issue.
804
- Function("r", "regeneratorRuntime = r")(runtime);
801
+ if (typeof globalThis === "object") {
802
+ globalThis.regeneratorRuntime = runtime;
803
+ } else {
804
+ Function("r", "regeneratorRuntime = r")(runtime);
805
+ }
805
806
  }
806
807
  });
807
808
 
@@ -1127,7 +1128,7 @@ function SlugEditorField(props) {
1127
1128
  }
1128
1129
  }, [props.titleValue, areEqual]);
1129
1130
  useSlugUpdater(props, check);
1130
- return React__default.createElement(SlugEditorFieldStatic, Object.assign({}, props, {
1131
+ return React__default.createElement(SlugEditorFieldStatic, _extends({}, props, {
1131
1132
  onChange: function onChange() {
1132
1133
  setCheck(false);
1133
1134
  },