@nocobase/plugin-field-code 2.0.34 → 2.0.35
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.
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("react"),require("@formily/react"),require("antd"),require("antd-style")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-code",["@nocobase/client","react","@formily/react","antd","antd-style"],t):"object"==typeof exports?exports["@nocobase/plugin-field-code"]=t(require("@nocobase/client"),require("react"),require("@formily/react"),require("antd"),require("antd-style")):e["@nocobase/plugin-field-code"]=t(e["@nocobase/client"],e.react,e["@formily/react"],e.antd,e["antd-style"])}(self,function(e,t,n,r,o){return function(){var i,c,u,a,l,s,f={840:function(e,t,n){"use strict";n.d(t,{S:function(){return u},r:function(){return a}});var r=n(581);function o(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var c=e.apply(t,n);function u(e){o(c,r,i,u,a,"next",e)}function a(e){o(c,r,i,u,a,"throw",e)}u(void 0)})}}function c(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var u=[{value:"javascript",label:"JavaScript",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_4vss2k_component",Promise.all([n.e("454"),n.e("685"),n.e("754"),n.e("856"),n.e("453")]).then(n.bind(n,558)))];case 1:return[2,(0,e.sent().javascript)()]}})})()}},{value:"java",label:"Java",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_-8tq2d4_component",Promise.all([n.e("454"),n.e("685"),n.e("754"),n.e("555")]).then(n.bind(n,517)))];case 1:return[2,(0,e.sent().java)()]}})})()}},{value:"sql",label:"SQL",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_-1s5b33f_component",Promise.all([n.e("454"),n.e("685"),n.e("754"),n.e("856"),n.e("155")]).then(n.bind(n,670)))];case 1:return[2,(0,e.sent().sql)()]}})})()}},{value:"python",label:"Python",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_e67311_component",Promise.all([n.e("454"),n.e("754"),n.e("463")]).then(n.bind(n,998)))];case 1:return[2,(0,e.sent().python)()]}})})()}},{value:"groovy",label:"Groovy",load:function(){return i(function(){var e,t;return c(this,function(o){switch(o.label){case 0:return[4,r("imported_-60lkaf_component",Promise.all([n.e("454"),n.e("558")]).then(n.bind(n,220)))];case 1:return e=o.sent().StreamLanguage,[4,r("imported_17juot3_component",n.e("320").then(n.bind(n,509)))];case 2:return t=o.sent().groovy,[2,e.define(t)]}})})()}}],a=Object.fromEntries(u.map(function(e){return[e.value,e]}))},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},505:function(e){"use strict";e.exports=n},772:function(t){"use strict";t.exports=e},721:function(e){"use strict";e.exports=r},202:function(e){"use strict";e.exports=o},156:function(e){"use strict";e.exports=t}},p={};function d(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return f[e](n,n.exports,d),n.exports}d.m=f,d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return""+({155:"16aa9f37d369f6e2",222:"74267117e0d4b7ff",320:"cdf9d585d88e9a91",453:"d2978b5b98ec2eb9",454:"f5d42ec1ec8c6c8a",463:"493578e28b69643e",555:"876bd327755c8631",558:"82436e2d7ff0bc4b",606:"19f99a0c5a40ead1",685:"ccd3cdd796458d5f",754:"2c65737397b4cb3b",856:"d171f7d76492119d"})[e]+".js"},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i={},c="@nocobase/plugin-field-code:",d.l=function(e,t,n,r){if(i[e])return void i[e].push(t);if(void 0!==n)for(var o,u,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var s=a[l];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==c+n){o=s;break}}o||(u=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.setAttribute("data-webpack",c+n),o.src=e),i[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),u&&document.head.appendChild(o)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(u=window.__webpack_public_path__||"/").endsWith("/")||(u+="/"),d.p=u+"static/plugins/@nocobase/plugin-field-code/dist/client/",a={909:0},d.f.j=function(e,t){var n=d.o(a,e)?a[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var o=d.p+d.u(e),i=Error();d.l(o,function(t){if(d.o(a,e)&&(0!==(n=a[e])&&(a[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==a[e]})){for(n in i)d.o(i,n)&&(d.m[n]=i[n]);c&&c(d)}for(e&&e(t);u<o.length;u++)r=o[u],d.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(s=self.webpackChunk_nocobase_plugin_field_code=self.webpackChunk_nocobase_plugin_field_code||[]).forEach(l.bind(null,0)),s.push=l.bind(null,s.push.bind(s));var b={};return!function(){"use strict";d.r(b),d.d(b,{codeComponentSettings:function(){return j},default:function(){return _},PluginFieldCodeClient:function(){return P}});var e=d(156),t=d(505),n=d(772),r="@nocobase/plugin-field-code",o=d(840);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var l=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,u,l,s,f;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return u=t,l=arguments,u=c(u),i(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(u,l||[],c(this).constructor):u.apply(this,l)),"name","code"),i(e,"type","object"),i(e,"group","advanced"),i(e,"order",1),i(e,"title",'{{t("Code", { ns: "'.concat(r,'" })}}')),i(e,"description",'{{t("Programming code editor with syntax highlighting.", { ns: "'.concat(r,'" })}}')),i(e,"sortable",!0),i(e,"default",{type:"text",uiSchema:{type:"string","x-component":"CodeEditor"}}),i(e,"properties",(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}({},n.defaultProps),f=f={"uiSchema.x-component-props.language":{type:"string",title:'{{t("Programming language", { ns: "'.concat(r,'" })}}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{showSearch:!0,allowClear:!0,placeholder:'{{t("Choose language", { ns: "'.concat(r,'" })}}')},enum:o.S.map(function(e){return{label:e.label,value:e.value}}),default:"javascript"}},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(f)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(f)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(f,e))}),s)),i(e,"titleUsable",!1),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e),t}(n.CollectionFieldInterface);function s(e){var t,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.i18n.t(e,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},i),o=o={ns:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t))}var f=d(581);function p(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function h(e,t,n){return(h=O()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&v(o,n.prototype),o}).apply(null,arguments)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t="function"==typeof Map?new Map:void 0;return(g=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}var w=(0,e.lazy)(function(){return f("imported_b24rcf_component",Promise.all([d.e("454"),d.e("685"),d.e("856"),d.e("558"),d.e("606"),d.e("222")]).then(d.bind(d,706)))}),j=new n.SchemaSettings({name:"fieldSettings:component:CodeEditor",items:[{name:"height",type:"modal",useComponentProps:function(){var e,o=(0,t.useField)(),i=(0,t.useFieldSchema)(),c=((0,n.useColumnSchema)()||{}).fieldSchema,u=(0,n.useDesignable)().dn,a=c||i;return{title:s("Content height"),schema:{type:"object",title:s("Content height"),properties:{height:{"x-decorator":"FormItem","x-component":"Input","x-component-props":{},default:(null==i||null==(e=i["x-component-props"])?void 0:e.height)||"auto",description:'{{t(\'Could use CSS values (e.g., "300px" or "50%"). Use "auto" for automatic height adjustment based on content.\', { ns: "'.concat(r,'" })}}')}}},onSubmit:function(e){var t=e.height,n=a["x-component-props"]||{};n.height=t;var r=y({},"x-uid",a["x-uid"]);r["x-component-props"]=n,a["x-component-props"]=n,o.componentProps.height=t,u.emit("patch",{schema:r}),u.refresh()}}}},{name:"indentUnit",type:"modal",useComponentProps:function(){var e,r=(0,t.useField)(),o=(0,t.useFieldSchema)(),i=((0,n.useColumnSchema)()||{}).fieldSchema,c=(0,n.useDesignable)().dn,u=i||o;return{title:s("Indent unit"),schema:{type:"object",title:s("Indent unit"),properties:{indentUnit:{"x-decorator":"FormItem","x-component":"Input","x-component-props":{},default:(null==o||null==(e=o["x-component-props"])?void 0:e.indentUnit)||2}}},onSubmit:function(e){var t=e.indentUnit,n=u["x-component-props"]||{};n.indentUnit=t;var o=y({},"x-uid",u["x-uid"]);o["x-component-props"]=n,u["x-component-props"]=n,r.componentProps.indentUnit=t,c.emit("patch",{schema:o}),c.refresh()}}}}]}),P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=m(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,O()?Reflect.construct(e,t||[],m(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&v(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return t.app.addComponents({CodeEditor:w}),t.app.dataSourceManager.addFieldInterfaces([l]),t.app.schemaSettingsManager.add(j),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){p(i,r,o,c,u,"next",e)}function u(e){p(i,r,o,c,u,"throw",e)}c(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(g(n.Plugin)),_=P}(),b}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("react"),require("@formily/react"),require("antd"),require("antd-style")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-code",["@nocobase/client","react","@formily/react","antd","antd-style"],t):"object"==typeof exports?exports["@nocobase/plugin-field-code"]=t(require("@nocobase/client"),require("react"),require("@formily/react"),require("antd"),require("antd-style")):e["@nocobase/plugin-field-code"]=t(e["@nocobase/client"],e.react,e["@formily/react"],e.antd,e["antd-style"])}(self,function(e,t,n,r,o){return function(){var i,c,u,a,l,s,f={840:function(e,t,n){"use strict";n.d(t,{S:function(){return u},r:function(){return a}});var r=n(581);function o(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var c=e.apply(t,n);function u(e){o(c,r,i,u,a,"next",e)}function a(e){o(c,r,i,u,a,"throw",e)}u(void 0)})}}function c(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}var u=[{value:"javascript",label:"JavaScript",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_4vss2k_component",Promise.all([n.e("454"),n.e("685"),n.e("754"),n.e("856"),n.e("453")]).then(n.bind(n,558)))];case 1:return[2,(0,e.sent().javascript)()]}})})()}},{value:"java",label:"Java",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_-8tq2d4_component",Promise.all([n.e("454"),n.e("685"),n.e("754"),n.e("555")]).then(n.bind(n,517)))];case 1:return[2,(0,e.sent().java)()]}})})()}},{value:"sql",label:"SQL",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_-1s5b33f_component",Promise.all([n.e("454"),n.e("685"),n.e("754"),n.e("856"),n.e("155")]).then(n.bind(n,670)))];case 1:return[2,(0,e.sent().sql)()]}})})()}},{value:"python",label:"Python",load:function(){return i(function(){return c(this,function(e){switch(e.label){case 0:return[4,r("imported_e67311_component",Promise.all([n.e("454"),n.e("754"),n.e("463")]).then(n.bind(n,998)))];case 1:return[2,(0,e.sent().python)()]}})})()}},{value:"groovy",label:"Groovy",load:function(){return i(function(){var e,t;return c(this,function(o){switch(o.label){case 0:return[4,r("imported_-60lkaf_component",Promise.all([n.e("454"),n.e("558")]).then(n.bind(n,220)))];case 1:return e=o.sent().StreamLanguage,[4,r("imported_17juot3_component",n.e("320").then(n.bind(n,509)))];case 2:return t=o.sent().groovy,[2,e.define(t)]}})})()}}],a=Object.fromEntries(u.map(function(e){return[e.value,e]}))},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},505:function(e){"use strict";e.exports=n},772:function(t){"use strict";t.exports=e},721:function(e){"use strict";e.exports=r},202:function(e){"use strict";e.exports=o},156:function(e){"use strict";e.exports=t}},p={};function d(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return f[e](n,n.exports,d),n.exports}d.m=f,d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return""+({155:"16aa9f37d369f6e2",222:"74267117e0d4b7ff",320:"cdf9d585d88e9a91",453:"d2978b5b98ec2eb9",454:"f5d42ec1ec8c6c8a",463:"493578e28b69643e",555:"876bd327755c8631",558:"82436e2d7ff0bc4b",606:"19f99a0c5a40ead1",685:"ccd3cdd796458d5f",754:"2c65737397b4cb3b",856:"d171f7d76492119d"})[e]+".js"},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i={},c="@nocobase/plugin-field-code:",d.l=function(e,t,n,r){if(i[e])return void i[e].push(t);if(void 0!==n)for(var o,u,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var s=a[l];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==c+n){o=s;break}}o||(u=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.setAttribute("data-webpack",c+n),o.src=e),i[e]=[t];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),u&&document.head.appendChild(o)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(u=window.__webpack_public_path__||"/").endsWith("/")||(u+="/"),d.p=u+"static/plugins/@nocobase/plugin-field-code/dist/client/",a={909:0},d.f.j=function(e,t){var n=d.o(a,e)?a[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=a[e]=[t,r]});t.push(n[2]=r);var o=d.p+d.u(e),i=Error();d.l(o,function(t){if(d.o(a,e)&&(0!==(n=a[e])&&(a[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==a[e]})){for(n in i)d.o(i,n)&&(d.m[n]=i[n]);c&&c(d)}for(e&&e(t);u<o.length;u++)r=o[u],d.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(s=self.webpackChunk_nocobase_plugin_field_code=self.webpackChunk_nocobase_plugin_field_code||[]).forEach(l.bind(null,0)),s.push=l.bind(null,s.push.bind(s));var b={};return!function(){"use strict";d.r(b),d.d(b,{codeComponentSettings:function(){return j},default:function(){return _},PluginFieldCodeClient:function(){return P}});var e=d(156),t=d(505),n=d(772),r="@nocobase/plugin-field-code",o=d(840);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var l=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,u,l,s,f;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return u=t,l=arguments,u=c(u),i(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(u,l||[],c(this).constructor):u.apply(this,l)),"name","code"),i(e,"type","object"),i(e,"group","advanced"),i(e,"order",1),i(e,"title",'{{t("Code", { ns: "'.concat(r,'" })}}')),i(e,"description",'{{t("Programming code editor with syntax highlighting.", { ns: "'.concat(r,'" })}}')),i(e,"sortable",!0),i(e,"default",{type:"text",uiSchema:{type:"string","x-component":"CodeEditor"}}),i(e,"availableTypes",["text"]),i(e,"properties",(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}({},n.defaultProps),f=f={"uiSchema.x-component-props.language":{type:"string",title:'{{t("Programming language", { ns: "'.concat(r,'" })}}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{showSearch:!0,allowClear:!0,placeholder:'{{t("Choose language", { ns: "'.concat(r,'" })}}')},enum:o.S.map(function(e){return{label:e.label,value:e.value}}),default:"javascript"}},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(f)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(f)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(f,e))}),s)),i(e,"titleUsable",!1),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e),t}(n.CollectionFieldInterface);function s(e){var t,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.i18n.t(e,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},i),o=o={ns:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t))}var f=d(581);function p(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function h(e,t,n){return(h=O()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&v(o,n.prototype),o}).apply(null,arguments)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t="function"==typeof Map?new Map:void 0;return(g=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)})(e)}function O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(O=function(){return!!e})()}var w=(0,e.lazy)(function(){return f("imported_b24rcf_component",Promise.all([d.e("454"),d.e("685"),d.e("856"),d.e("558"),d.e("606"),d.e("222")]).then(d.bind(d,706)))}),j=new n.SchemaSettings({name:"fieldSettings:component:CodeEditor",items:[{name:"height",type:"modal",useComponentProps:function(){var e,o=(0,t.useField)(),i=(0,t.useFieldSchema)(),c=((0,n.useColumnSchema)()||{}).fieldSchema,u=(0,n.useDesignable)().dn,a=c||i;return{title:s("Content height"),schema:{type:"object",title:s("Content height"),properties:{height:{"x-decorator":"FormItem","x-component":"Input","x-component-props":{},default:(null==i||null==(e=i["x-component-props"])?void 0:e.height)||"auto",description:'{{t(\'Could use CSS values (e.g., "300px" or "50%"). Use "auto" for automatic height adjustment based on content.\', { ns: "'.concat(r,'" })}}')}}},onSubmit:function(e){var t=e.height,n=a["x-component-props"]||{};n.height=t;var r=y({},"x-uid",a["x-uid"]);r["x-component-props"]=n,a["x-component-props"]=n,o.componentProps.height=t,u.emit("patch",{schema:r}),u.refresh()}}}},{name:"indentUnit",type:"modal",useComponentProps:function(){var e,r=(0,t.useField)(),o=(0,t.useFieldSchema)(),i=((0,n.useColumnSchema)()||{}).fieldSchema,c=(0,n.useDesignable)().dn,u=i||o;return{title:s("Indent unit"),schema:{type:"object",title:s("Indent unit"),properties:{indentUnit:{"x-decorator":"FormItem","x-component":"Input","x-component-props":{},default:(null==o||null==(e=o["x-component-props"])?void 0:e.indentUnit)||2}}},onSubmit:function(e){var t=e.indentUnit,n=u["x-component-props"]||{};n.indentUnit=t;var o=y({},"x-uid",u["x-uid"]);o["x-component-props"]=n,u["x-component-props"]=n,r.componentProps.indentUnit=t,c.emit("patch",{schema:o}),c.refresh()}}}}]}),P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=m(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,O()?Reflect.construct(e,t||[],m(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&v(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return t.app.addComponents({CodeEditor:w}),t.app.dataSourceManager.addFieldInterfaces([l]),t.app.schemaSettingsManager.add(j),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){p(i,r,o,c,u,"next",e)}function u(e){p(i,r,o,c,u,"throw",e)}c(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(g(n.Plugin)),_=P}(),b}()});
|
package/dist/externalVersion.js
CHANGED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据表字段:代码",
|
|
5
5
|
"description": "For code editing and highlighting, supporting Java, JavaScript, Python, SQL and other languages.",
|
|
6
6
|
"description.zh-CN": "用于代码编辑和高亮显示,支持 Java、JavaScript、Python、SQL 等语言。",
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.35",
|
|
8
8
|
"main": "dist/server/index.js",
|
|
9
9
|
"nocobase": {
|
|
10
10
|
"supportedVersions": [
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"Collection fields"
|
|
37
37
|
],
|
|
38
38
|
"license": "Apache-2.0",
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "724e9b28057c9033b9d57bdbeda5a331c9dcc646"
|
|
40
40
|
}
|