diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a9c0afa..c9559324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for CKEditor for Craft CMS +## Unreleased + +- CKEditor config edit pages now warn when switching the Config Options setting from JavaScript to JSON if the JavaScript code contains any functions. ([#152](https://github.com/craftcms/ckeditor/issues/152), [#180](https://github.com/craftcms/ckeditor/pull/180)) + ## 3.8.0 - 2024-02-21 - Added support for creating anchor links. ([#169](https://github.com/craftcms/ckeditor/discussions/169)) diff --git a/src/translations/en/ckeditor.php b/src/translations/en/ckeditor.php index 4500e450..fe78e957 100644 --- a/src/translations/en/ckeditor.php +++ b/src/translations/en/ckeditor.php @@ -42,6 +42,7 @@ 'View available settings' => 'View available settings', 'Word Limit' => 'Word Limit', 'You can save custom {name} configs as {ext} files in {path}.' => 'You can save custom {name} configs as {ext} files in {path}.', + 'Your JavaScript config contains functions. If you switch to JSON, they will be lost. Would you like to continue?', '{attribute} isn’t valid JSON.' => '{attribute} isn’t valid JSON.', '{field} should contain at most {max, number} {max, plural, one{word} other{words}}.' => '{field} should contain at most {max, number} {max, plural, one{word} other{words}}.', ]; diff --git a/src/web/assets/ckeconfig/dist/ckeconfig.js b/src/web/assets/ckeconfig/dist/ckeconfig.js index 3cbf6a36..517f5262 100644 --- a/src/web/assets/ckeconfig/dist/ckeconfig.js +++ b/src/web/assets/ckeconfig/dist/ckeconfig.js @@ -1,3 +1,3 @@ /*! For license information please see ckeconfig.js.LICENSE.txt */ -(function(){var __webpack_modules__={150:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _ckeconfig_css__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(778),_ckeconfig_css__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_ckeconfig_css__WEBPACK_IMPORTED_MODULE_0__),jquery__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(311),jquery__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rr.parts.length&&(n.parts.length=r.parts.length)}else{var a=[];for(o=0;o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1){var r=u.value.findIndex((function(e){return t.some((function(t){return t.button===e}))}));if(-1!==r)for(var o=0;o'),n=t()('
').appendTo(r);return e.appendTo(n),r},moveHelperToCursor:!0,onDragStart:function(){Garnish.$bod.addClass("dragging");var e=u.drag.$draggee;if(u.draggingSourceItem=t().contains(u.$sourceContainer[0],e[0]),u.draggingSeparator=e.hasClass("ckeditor-tb--separator"),u.$insertion=t()('
').css({width:e.outerWidth()}),u.draggingSourceItem)if(u.draggingSeparator)e.css("visibility","");else{var r="ltr"===Craft.orientation?"margin-right":"margin-left",n=-1*e.outerWidth();e.stop().velocity(s({},r,n),200,(function(){e.addClass("hidden")}))}else e.addClass("hidden"),u.$insertion.insertBefore(e),u.showingInsertion=!0;u.setMidpoints()},onDrag:function(){u.checkForNewClosestItem()},onDragStop:function(){Garnish.$bod.removeClass("dragging");var e=u.drag.$draggee;if(u.checkForNewClosestItem(),u.showingInsertion)if(u.draggingSourceItem){var r;if(u.draggingSeparator)r=u.renderSeparator();else{var a=e.data("componentNames");r=u.renderComponentGroup(a);var c,l=o(a);try{var d=function(){var e=c.value,t=f.flat().find((function(t){return t.button===e}));t&&t.configOption&&i.addSetting(t.configOption)};for(l.s();!(c=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}}r.data("sourceItem",e[0]),r.css("visibility","hidden"),u.$insertion.replaceWith(r),u.drag.$draggee=r}else u.$insertion.replaceWith(e),e.removeClass("hidden");else{if(!u.draggingSourceItem){var _=t()(e.data("sourceItem"));if(e.remove(),u.drag.$draggee=e=_,!u.draggingSeparator){var p,h=o(_.data("componentNames"));try{var g=function(){var e=p.value,t=f.flat().find((function(t){return t.button===e}));t&&t.configOption&&i.removeSetting(t.configOption)};for(h.s();!(p=h.n()).done;)g()}catch(e){h.e(e)}finally{h.f()}}}if(!u.draggingSeparator){e.removeClass("hidden");var m="ltr"===Craft.orientation?"margin-right":"margin-left",v=e.css(m);e.css(m,"");var y=e.css(m);e.css(m,v),e.stop().velocity(s({},m,y),200,(function(){e.css(m,"")}))}}u.drag.returnHelpersToDraggees(),u.$items=u.$targetContainer.children(),u.value=[];var b,j=o(u.$items.toArray());try{for(j.s();!(b=j.n()).done;){var C,w=b.value,E=t()(w);E.hasClass("ckeditor-tb--separator")?u.value.push("|"):(C=u.value).push.apply(C,n(E.data("componentNames")))}}catch(e){j.e(e)}finally{j.f()}u.$input.val(JSON.stringify(u.value))}});var h,g={},m=o(f);try{for(m.s();!(h=m.n()).done;){var v=h.value,y=u.renderComponentGroup(v);y&&(y.appendTo(u.$sourceContainer),g[v.map((function(e){return e.button})).join(",")]=y[0],u.value.includes(v[0].button)&&y.addClass("hidden"))}}catch(e){m.e(e)}finally{m.f()}g["|"]=u.renderSeparator().appendTo(u.$sourceContainer)[0],u.$items=t()();for(var b=function(e){var t,r,n=u.value[e];if("|"===n)t=u.renderSeparator().appendTo(u.$targetContainer),r="|";else{var o=f.find((function(e){return e.some((function(e){return e.button===n}))}));if(!o)return j=e,0;if(!(t=u.renderComponentGroup(o)))return j=e,0;t.appendTo(u.$targetContainer),r=o.map((function(e){return e.button})).join(","),e+=o.length-1}t.data("sourceItem",g[r]),u.$items=u.$items.add(t),j=e},j=0;j
');return this.drag.addItems(e),e},renderComponentGroup:function(e){var r,n=[],i=[],a=o(e=e.map((function(e){return"string"==typeof e?e:e.button})));try{for(a.s();!(r=a.n()).done;){var s=r.value,u=void 0;try{u=this.renderComponent(s)}catch(e){console.warn(e);continue}n.push(u);var c=(u.is("[data-cke-tooltip-text]")?u:u.find("[data-cke-tooltip-text]")).attr("data-cke-tooltip-text");i.push(c?c.replace(/ \(.*\)$/,""):"".concat(s[0].toUpperCase()).concat(s.slice(1)))}}catch(e){a.e(e)}finally{a.f()}if(!n.length)return!1;var l=t()('
').append(n);return l.attr("data-cke-tooltip-text",i.join(", ")),l.data("componentNames",e),this.drag.addItems(l),l},renderComponent:function(e){var r=this.components[e];if(!r)throw"Missing component: ".concat(e);r.isRendered||r.render();var n=t()(r.element.outerHTML);return n.data("componentName",e),n},getClosestItem:function(){var e=this;if(!Garnish.hitTest(this.drag.mouseX,this.drag.mouseY,this.$targetContainer))return!1;if(!this.$items.length)return null;var r=this.$items.toArray();this.showingInsertion&&r.push(this.$insertion[0]);var o=r.map((function(r){var n=t().data(r,"midpoint");return Garnish.getDist(n.left,n.top,e.drag.mouseX,e.drag.mouseY)})),i=Math.min.apply(Math,n(o));return r[o.indexOf(i)]},checkForNewClosestItem:function(){var e=this.getClosestItem();!1!==e?e!==this.$insertion[0]&&(e?this.drag.mouseX=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1){var n=u.value.findIndex((function(t){return e.some((function(e){return e.button===t}))}));if(-1!==n)for(var o=0;o'),r=e()('
').appendTo(n);return t.appendTo(r),n},moveHelperToCursor:!0,onDragStart:function(){Garnish.$bod.addClass("dragging");var t=u.drag.$draggee;if(u.draggingSourceItem=e().contains(u.$sourceContainer[0],t[0]),u.draggingSeparator=t.hasClass("ckeditor-tb--separator"),u.$insertion=e()('
').css({width:t.outerWidth()}),u.draggingSourceItem)if(u.draggingSeparator)t.css("visibility","");else{var n="ltr"===Craft.orientation?"margin-right":"margin-left",r=-1*t.outerWidth();t.stop().velocity(s({},n,r),200,(function(){t.addClass("hidden")}))}else t.addClass("hidden"),u.$insertion.insertBefore(t),u.showingInsertion=!0;u.setMidpoints()},onDrag:function(){u.checkForNewClosestItem()},onDragStop:function(){Garnish.$bod.removeClass("dragging");var t=u.drag.$draggee;if(u.checkForNewClosestItem(),u.showingInsertion)if(u.draggingSourceItem){var n;if(u.draggingSeparator)n=u.renderSeparator();else{var a=t.data("componentNames");n=u.renderComponentGroup(a);var c,l=o(a);try{var d=function(){var t=c.value,e=f.flat().find((function(e){return e.button===t}));e&&e.configOption&&i.addSetting(e.configOption)};for(l.s();!(c=l.n()).done;)d()}catch(t){l.e(t)}finally{l.f()}}n.data("sourceItem",t[0]),n.css("visibility","hidden"),u.$insertion.replaceWith(n),u.drag.$draggee=n}else u.$insertion.replaceWith(t),t.removeClass("hidden");else{if(!u.draggingSourceItem){var _=e()(t.data("sourceItem"));if(t.remove(),u.drag.$draggee=t=_,!u.draggingSeparator){var p,h=o(_.data("componentNames"));try{var g=function(){var t=p.value,e=f.flat().find((function(e){return e.button===t}));e&&e.configOption&&i.removeSetting(e.configOption)};for(h.s();!(p=h.n()).done;)g()}catch(t){h.e(t)}finally{h.f()}}}if(!u.draggingSeparator){t.removeClass("hidden");var m="ltr"===Craft.orientation?"margin-right":"margin-left",v=t.css(m);t.css(m,"");var y=t.css(m);t.css(m,v),t.stop().velocity(s({},m,y),200,(function(){t.css(m,"")}))}}u.drag.returnHelpersToDraggees(),u.$items=u.$targetContainer.children(),u.value=[];var b,C=o(u.$items.toArray());try{for(C.s();!(b=C.n()).done;){var j,w=b.value,E=e()(w);E.hasClass("ckeditor-tb--separator")?u.value.push("|"):(j=u.value).push.apply(j,r(E.data("componentNames")))}}catch(t){C.e(t)}finally{C.f()}u.$input.val(JSON.stringify(u.value))}});var h,g={},m=o(f);try{for(m.s();!(h=m.n()).done;){var v=h.value,y=u.renderComponentGroup(v);y&&(y.appendTo(u.$sourceContainer),g[v.map((function(t){return t.button})).join(",")]=y[0],u.value.includes(v[0].button)&&y.addClass("hidden"))}}catch(t){m.e(t)}finally{m.f()}g["|"]=u.renderSeparator().appendTo(u.$sourceContainer)[0],u.$items=e()();for(var b=function(t){var e,n,r=u.value[t];if("|"===r)e=u.renderSeparator().appendTo(u.$targetContainer),n="|";else{var o=f.find((function(t){return t.some((function(t){return t.button===r}))}));if(!o)return C=t,0;if(!(e=u.renderComponentGroup(o)))return C=t,0;e.appendTo(u.$targetContainer),n=o.map((function(t){return t.button})).join(","),t+=o.length-1}e.data("sourceItem",g[n]),u.$items=u.$items.add(e),C=t},C=0;C
');return this.drag.addItems(t),t},renderComponentGroup:function(t){var n,r=[],i=[],a=o(t=t.map((function(t){return"string"==typeof t?t:t.button})));try{for(a.s();!(n=a.n()).done;){var s=n.value,u=void 0;try{u=this.renderComponent(s)}catch(t){console.warn(t);continue}r.push(u);var c=(u.is("[data-cke-tooltip-text]")?u:u.find("[data-cke-tooltip-text]")).attr("data-cke-tooltip-text");i.push(c?c.replace(/ \(.*\)$/,""):"".concat(s[0].toUpperCase()).concat(s.slice(1)))}}catch(t){a.e(t)}finally{a.f()}if(!r.length)return!1;var l=e()('
').append(r);return l.attr("data-cke-tooltip-text",i.join(", ")),l.data("componentNames",t),this.drag.addItems(l),l},renderComponent:function(t){var n=this.components[t];if(!n)throw"Missing component: ".concat(t);n.isRendered||n.render();var r=e()(n.element.outerHTML);return r.data("componentName",t),r},getClosestItem:function(){var t=this;if(!Garnish.hitTest(this.drag.mouseX,this.drag.mouseY,this.$targetContainer))return!1;if(!this.$items.length)return null;var n=this.$items.toArray();this.showingInsertion&&n.push(this.$insertion[0]);var o=n.map((function(n){var r=e().data(n,"midpoint");return Garnish.getDist(r.left,r.top,t.drag.mouseX,t.drag.mouseY)})),i=Math.min.apply(Math,r(o));return n[o.indexOf(i)]},checkForNewClosestItem:function(){var t=this.getClosestItem();!1!==t?t!==this.$insertion[0]&&(t?this.drag.mouseX {\n this.language = $selectedOption.data('language');\n switch (this.language) {\n case 'json':\n this.$jsonContainer.removeClass('hidden');\n this.$jsContainer.addClass('hidden');\n const json = this.js2json(this.jsEditor.getModel().getValue());\n this.jsonEditor.getModel().setValue(json || '{\\n \\n}');\n this.jsEditor.getModel().setValue('');\n break;\n case 'js':\n this.$jsonContainer.addClass('hidden');\n this.$jsContainer.removeClass('hidden');\n const js = this.json2js(this.jsonEditor.getModel().getValue());\n this.jsEditor.getModel().setValue(js || 'return {\\n \\n}');\n this.jsonEditor.getModel().setValue('');\n break;\n }\n },\n });\n\n // Handle Paste\n this.jsonEditor.onDidPaste((ev) => {\n const pastedContent = this.jsonEditor\n .getModel()\n .getValueInRange(ev.range);\n let config;\n try {\n eval(`config = {${pastedContent}}`);\n } catch (e) {\n // oh well\n return;\n }\n const json = JSON.stringify(config, null, 2);\n const trimmed = Craft.trim(json.substring(1, json.length - 1));\n if (!trimmed) {\n return;\n }\n this.jsonEditor.executeEdits('', [\n {\n range: ev.range,\n text: trimmed,\n },\n ]);\n });\n },\n\n getConfig: function () {\n let json;\n if (this.language === 'json') {\n json = Craft.trim(this.jsonEditor.getModel().getValue()) || '{}';\n } else {\n const value = Craft.trim(this.jsEditor.getModel().getValue());\n json = value ? this.js2json(value) : '{}';\n if (json === false) {\n return false;\n }\n }\n\n try {\n const config = JSON.parse(json);\n return $.isPlainObject(config) ? config : false;\n } catch (e) {\n return false;\n }\n },\n\n setConfig: function (config) {\n const json = this.config2json(config);\n\n if (this.language === 'json') {\n this.jsonEditor.getModel().setValue(json);\n } else {\n const js = this.json2js(json);\n this.jsEditor.getModel().setValue(js || 'return {\\n \\n}');\n }\n },\n\n addSetting: function (setting) {\n const config = this.getConfig();\n if (!config) {\n return;\n }\n\n // already present?\n if (typeof config[setting] !== 'undefined') {\n return;\n }\n\n if (typeof this.defaults[setting] === 'undefined') {\n this.populateDefault(setting);\n if (typeof this.defaults[setting] === 'undefined') {\n return;\n }\n }\n\n config[setting] = this.defaults[setting];\n this.setConfig(config);\n },\n\n removeSetting: function (setting) {\n const config = this.getConfig();\n if (!config) {\n return;\n }\n\n // not present?\n if (typeof config[setting] === 'undefined') {\n return;\n }\n\n // keep track of the value in case the setting needs to be added back later\n this.defaults[setting] = config[setting];\n\n delete config[setting];\n this.setConfig(config);\n },\n\n populateDefault: function (setting) {\n let schema;\n try {\n schema =\n window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.find(\n (s) => s.uri === this.jsonSchemaUri,\n ).schema;\n } catch (e) {\n console.warn('Couldn’t get config options JSON schema.', e);\n return;\n }\n\n if (\n !schema.$defs ||\n !schema.$defs.EditorConfig ||\n !schema.$defs.EditorConfig.properties\n ) {\n console.warn(\n 'Config options JSON schema is missing $defs.EditorConfig.properties',\n );\n return;\n }\n\n if (!schema.$defs.EditorConfig.properties[setting]) {\n return;\n }\n\n const property = schema.$defs.EditorConfig.properties[setting];\n if (property.default) {\n this.defaults[setting] = property.default;\n return;\n }\n\n if (!property.$ref) {\n return;\n }\n\n const m = property.$ref.match(/^#\\/\\$defs\\/(\\w+)/);\n if (!m) {\n return;\n }\n\n const defName = m[1];\n if (!schema.$defs[defName] || !schema.$defs[defName].default) {\n return;\n }\n\n this.defaults[setting] = schema.$defs[defName].default;\n },\n\n config2json: function (config) {\n let json = JSON.stringify(config, null, 2);\n if (json === '{}') {\n json = '{\\n \\n}';\n }\n return json;\n },\n\n js2json: function (js) {\n const m = (js || '').match(/return\\s*(\\{[\\w\\W]*})/);\n if (!m) {\n return false;\n }\n let config;\n // See if it's valid JSON\n try {\n eval(`config = ${m[1]};`);\n } catch (e) {\n // oh well\n return false;\n }\n return this.config2json(config);\n },\n\n json2js: function (json) {\n let config;\n try {\n config = JSON.parse(json);\n } catch (e) {\n return false;\n }\n if (!$.isPlainObject(config)) {\n return false;\n }\n let js = this.jsify(config, '');\n if (js === '{\\n}') {\n js = '{\\n \\n}';\n }\n return `return ${js}`;\n },\n\n jsify: function (value, indent) {\n let js;\n if ($.isArray(value)) {\n js = '[\\n';\n for (const v of value) {\n js += `${indent} ${this.jsify(v, indent + ' ')},\\n`;\n }\n js += `${indent}]`;\n } else if ($.isPlainObject(value)) {\n js = '{\\n';\n for (const [k, v] of Object.entries(value)) {\n js += `${indent} ${k}: ${this.jsify(v, indent + ' ')},\\n`;\n }\n js += `${indent}}`;\n } else if (typeof value === 'string' && !value.match(/[\\r\\n']/)) {\n js = `'${value}'`;\n } else {\n js = JSON.stringify(value);\n }\n return js;\n },\n});\n","// style-loader: Adds some css to the DOM by adding a