@nocobase/plugin-block-comment 2.2.0-alpha.4
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/LICENSE.txt +107 -0
- package/README.md +1 -0
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/41.ba29684041883153.js +10 -0
- package/dist/client/487.765503d66e8a89d7.js +10 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.js +10 -0
- package/dist/client/locale.d.ts +11 -0
- package/dist/client/models/index.d.ts +11 -0
- package/dist/client/plugin.d.ts +13 -0
- package/dist/client-v2/41.086705405800c55e.js +10 -0
- package/dist/client-v2/487.245836fea93ad510.js +10 -0
- package/dist/client-v2/index.d.ts +9 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +11 -0
- package/dist/client-v2/models/RecordCommentsBlockModel.d.ts +58 -0
- package/dist/client-v2/models/actions/DeleteRecordCommentActionModel.d.ts +15 -0
- package/dist/client-v2/models/actions/EditRecordCommentActionModel.d.ts +15 -0
- package/dist/client-v2/models/actions/QuoteReplyRecordCommentActionModel.d.ts +15 -0
- package/dist/client-v2/models/actions/RecordCommentActionGroupModel.d.ts +19 -0
- package/dist/client-v2/models/actions/index.d.ts +12 -0
- package/dist/client-v2/models/components/RecordCommentActions.d.ts +19 -0
- package/dist/client-v2/models/components/RecordCommentFieldSelect.d.ts +15 -0
- package/dist/client-v2/models/components/RecordCommentsBlockView.d.ts +34 -0
- package/dist/client-v2/models/utils/errors.d.ts +9 -0
- package/dist/client-v2/models/utils.d.ts +131 -0
- package/dist/client-v2/plugin.d.ts +13 -0
- package/dist/externalVersion.js +21 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +40 -0
- package/dist/locale/zh-CN.json +40 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +42 -0
- package/dist/server/plugin.d.ts +19 -0
- package/dist/server/plugin.js +54 -0
- package/package.json +20 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@emotion/css"),require("@nocobase/client-v2"),require("@formily/reactive"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-block-comment/client-v2",["@emotion/css","@nocobase/client-v2","@formily/reactive","react","antd","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-block-comment/client-v2"]=t(require("@emotion/css"),require("@nocobase/client-v2"),require("@formily/reactive"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):e["@nocobase/plugin-block-comment/client-v2"]=t(e["@emotion/css"],e["@nocobase/client-v2"],e["@formily/reactive"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,u,c){return function(){"use strict";var l,a,f,s={376:function(e,t,n){n.d(t,{J:function(){return a}});var r=n(694),o=n(59),i=n(155),u=n.n(i),c=n(488),l=n(626),a=(0,r.observer)(function(e){var t,n,a=e.value,f=e.onChange,s=e.fieldFilter,p=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["value","onChange","fieldFilter"]),b=(0,c.kj)(),d=(0,r.useFlowSettingsContext)(),y=null==d?void 0:d.model,v=(null==y?void 0:y.collection)||(null==d?void 0:d.collection),m=(0,i.useMemo)(function(){return"owner"===s?(0,l.dy)(v):"content"===s?(0,l.p3)(v):"date"===s?(0,l.GZ)(v):"user"===s?(0,l.vt)(v):(0,l.TP)(v)},[v,s]);return u().createElement(o.Select,(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}({},p),n=n={showSearch:!0,allowClear:!0,optionFilterProp:"label",placeholder:b("Select field"),style:{width:"100%"},value:a,onChange:f,options:m},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})},488:function(e,t,n){n.d(t,{CU:function(){return u},MZ:function(){return l},kj:function(){return c}});var r=n(694);function o(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}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var u="@nocobase/plugin-block-comment";function c(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,i(o({},n||{}),{ns:[u,"client"]}))}}function l(e,t){return(0,r.tExpr)(e,i(o({},t||{}),{ns:[u,"client"]}))}},626:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,o,i,u){try{var c=e[i](u),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}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 u(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}n.d(t,{Em:function(){return q},GZ:function(){return w},IU:function(){return X},KY:function(){return H},Mm:function(){return V},O2:function(){return W},Qg:function(){return C},TP:function(){return d},Tf:function(){return b},Xo:function(){return l},d_:function(){return $},dy:function(){return k},gX:function(){return F},p3:function(){return h},so:function(){return z},tH:function(){return E},vt:function(){return _},yQ:function(){return c},zi:function(){return N}});var c=20,l="record-comments-owner",a="{{ ctx.view.inputArgs.filterByTk }}",f=function(e){return!!(e&&(void 0===e?"undefined":u(e))==="object")},s=function(e){return"string"==typeof e?e:Array.isArray(e)&&1===e.length&&"string"==typeof e[0]?e[0]:void 0},p=function(e){var t,n,r;return f(e)?"function"==typeof(null==e?void 0:e.getFields)?e.getFields():(n=e.fields,null!=(r=Map)&&"u">typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)?Array.from(e.fields.values()):(null==e?void 0:e.fields)||(null==e||null==(t=e.options)?void 0:t.fields)||[]:[]},b=function(e,t){if(t)return f(e)&&"function"==typeof(null==e?void 0:e.getField)?e.getField(t):p(e).find(function(e){return e.name===t})},d=function(e){return p(e).filter(function(e){return e.name}).map(function(e){var t;return{label:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,value:e.name}})},y=new Set(["string","text"]),v=new Set(["input","markdown","richText","text","textarea","vditor"]),m=new Set(["date","dateOnly","datetime","time","unixTimestamp"]),g=new Set(["createdAt","date","dateOnly","datetime","time","unixTimestamp","updatedAt"]),h=function(e){return p(e).filter(function(e){return e.name&&!!e&&(e.interface?v.has(e.interface):y.has(e.type||""))}).map(function(e){var t;return{label:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,value:e.name}})},w=function(e){return p(e).filter(function(e){return e.name&&!!e&&(e.interface?g.has(e.interface):m.has(e.type||""))}).map(function(e){var t;return{label:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,value:e.name}})},O=function(e){return(null==e?void 0:e.type)==="belongsTo"||(null==e?void 0:e.interface)==="m2o"},j=new Set(["belongsToArray","belongsToMany","hasMany","hasOne"]),S=new Set(["m2m","o2m","oho","obo"]),x=function(e){return!(!(null==e?void 0:e.name)||e.type&&j.has(e.type)||e.interface&&S.has(e.interface)||O(e))},P=function(e){var t;return O(e)&&((null==e?void 0:e.target)==="users"||(null==e||null==(t=e.targetCollection)?void 0:t.name)==="users")},k=function(e){return p(e).filter(x).map(function(e){var t;return{label:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,value:e.name}})},_=function(e){return p(e).filter(function(e){return e.name&&P(e)}).map(function(e){var t;return{label:e.title||(null==(t=e.uiSchema)?void 0:t.title)||e.name,value:e.name}})},A=function(e){var t,n=e.collection,r=e.currentCollectionName;if(!r)return{};var o=null==(t=p(n).find(function(e){var t;return!!e.name&&!!O(e)&&(e.target===r||(null==(t=e.targetCollection)?void 0:t.name)===r)}))?void 0:t.name;return o?{ownerField:o,ownerValueField:a}:{}},T=function(e){var t,n,o=e.association,i=e.associationName;return(null==o||null==(n=o.collection)?void 0:n.name)?o.collection.name:i&&(function(e){if(Array.isArray(e))return e}(t=i.split("."))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){u=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return r(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,1)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0]||void 0},C=function(e){var t,n,r,o,u,c=null==(r=e.association)?void 0:r.foreignKey;if(c&&b(e.collection,c))return{ownerField:c,ownerValueField:null!=(o=e.sourceId)?o:a};var l=T(e),f=A({collection:e.collection,currentCollectionName:l});return f.ownerField?(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){i(e,t,n[t])})}return e}({},f),n=n={ownerValueField:null!=(u=e.sourceId)?u:f.ownerValueField},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t):{}},E=function(e){var t;return f(e)&&(s(null==e?void 0:e.filterTargetKey)||(null==(t=p(e).find(function(e){return e.primaryKey}))?void 0:t.name))||"id"},F=function(e,t){if(e){try{var n,r=f(t)?null==t||null==(n=t.getFilterByTK)?void 0:n.call(t,e):void 0;if("string"==typeof r||"number"==typeof r)return r}catch(e){}var o=E(t),i=o?e[o]:void 0;return"string"==typeof i||"number"==typeof i?i:void 0}},M=function(e){if("string"==typeof e)return e;if(!(!e||(void 0===e?"undefined":u(e))!=="object"||Array.isArray(e))){var t=e.value;return"string"==typeof t?t:void 0}},q=function(e,t){var n=M(t);if(e&&n)return n.split(".").reduce(function(e,t){if(e&&(void 0===e?"undefined":u(e))==="object")return e[t]},e)},I=function(e){var t=M(e);return!!t&&/^\{\{\s*ctx(?:\..+?)?\s*\}\}$/.test(t.trim())},R=function(e){var t=M(e);return!!t&&/^ctx(?:\..+?)?$/.test(t.trim())},$=function(e){return I(e)||R(e)},D=function(e){var t=M(e);if(t){var n=t.trim();if(I(n))return n;if(R(n))return"{{ ".concat(n," }}")}},N=function(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(e&&(void 0===e?"undefined":u(e))==="object"&&!Array.isArray(e)){var t,n,r=null!=(t=null!=(n=e.id)?n:e.value)?t:e.key;if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)return r}},B=new Set(["integer","bigInt","double","float","decimal","real"]),K=new Set(["boolean"]),G=new Set(["string","text","uid","uuid","email","phone","url","password","radioGroup","select"]),L=function(e,t){if(!t)return{compatible:!0,value:e};if(t&&(B.has(t.type||"")||B.has(t.interface||""))){if("number"==typeof e)return Number.isFinite(e)?{compatible:!0,value:e}:{compatible:!1};if("string"==typeof e&&""!==e.trim()){var n=Number(e);return Number.isFinite(n)?{compatible:!0,value:n}:{compatible:!1}}return{compatible:!1}}if(t&&(K.has(t.type||"")||K.has(t.interface||""))){if("boolean"==typeof e)return{compatible:!0,value:e};if("string"==typeof e){var r=e.trim().toLowerCase();if("true"===r||"1"===r)return{compatible:!0,value:!0};if("false"===r||"0"===r)return{compatible:!0,value:!1}}return{compatible:!1}}return t&&(G.has(t.type||"")||G.has(t.interface||""))?{compatible:!0,value:String(e)}:{compatible:!0,value:e}},U=function(e,t){var n,r=b(e,t);if(!O(r))return r;var o=(null==r?void 0:r.targetKey)||s(null==r||null==(n=r.targetCollection)?void 0:n.filterTargetKey)||"id";return b(null==r?void 0:r.targetCollection,o)},V=function(e,t,n){return L(n,U(e,t))},J=function(e){var t=M(e);if(t){var n=t.trim(),r=n.match(/^\{\{\s*(ctx\.(?:record|popup\.record)(?:\..+?)?)\s*\}\}$/);if(r)return r[1];if(/^(?:ctx\.)?(?:record|popup\.record)(?:\..+?)?$/.test(n))return n.startsWith("ctx.")?n:"ctx.".concat(n)}},Q=function(e){var t=M(e);if(!t)return!1;var n=t.trim().replace(/\s+/g,"");return"ctx.view.inputArgs.filterByTk"===n||"ctx.inputArgs.filterByTk"===n||"{{ctx.view.inputArgs.filterByTk}}"===n||"{{ctx.inputArgs.filterByTk}}"===n},Z=function(e,t){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(!(!e||(void 0===e?"undefined":u(e))!=="object"||Array.isArray(e))){if(t){var n=e[t];if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)return n}return N(e)}},X=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";if(Q(e))return Z(t,n);var r=J(e);if(!r)return"number"!=typeof e&&"boolean"!=typeof e&&("string"!=typeof e||$(e))?void 0:e;if("ctx.record"===r||r==="ctx.record.".concat(n)||"ctx.popup.record"===r||r==="ctx.popup.record.".concat(n)){var o=Z(t,n);if(void 0!==o)return o}},z=function(e,t,n){var r,o=b(e,t);return O(o)?i({},t,i({},(null==o?void 0:o.targetKey)||s(null==o||null==(r=o.targetCollection)?void 0:r.filterTargetKey)||"id",{$eq:n})):i({},t,{$eq:n})},H=function(e,t){var n;return(n=function(){var n,r,o;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:l(0)}),c(u,"throw",{value:l(1)}),c(u,"return",{value:l(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function l(c){return function(l){var a=[c,l];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)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 i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}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(i){switch(i.label){case 0:if(!(r=D(t)))return[3,2];return[4,null==(n=e.resolveJsonTemplate)?void 0:n.call(e,r)];case 1:return o=i.sent(),[3,3];case 2:o=q(e.record,t),i.label=3;case 3:return[2,N(o)]}})},function(){var e=this,t=arguments;return new Promise(function(r,i){var u=n.apply(e,t);function c(e){o(u,r,i,c,l,"next",e)}function l(e){o(u,r,i,c,l,"throw",e)}c(void 0)})})()},W=function(e){if(null==e||""===e)return"-";if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return String(e);if(Array.isArray(e))return e.map(function(e){return W(e)}).join(", ");if((void 0===e?"undefined":u(e))==="object"){var t,n,r,o,i;return String(null!=(t=null!=(n=null!=(r=null!=(o=null!=(i=e.title)?i:e.name)?o:e.nickname)?r:e.username)?n:e.id)?t:"-")}return String(e)}},375:function(e){e.exports=i},477:function(t){t.exports=e},992:function(e){e.exports=n},485:function(e){e.exports=t},694:function(e){e.exports=u},768:function(e){e.exports=c},59:function(e){e.exports=o},155:function(e){e.exports=r}},p={};function b(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return s[e](n,n.exports,b),n.exports}b.m=s,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({41:"086705405800c55e",487:"245836fea93ad510"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d={},b.l=function(e,t,n,r){if(d[e])return void d[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var l=u[c];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-block-comment/client-v2:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-block-comment/client-v2:"+n),o.src=e),d[e]=[t];var a=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(a.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=a.bind(null,o.onerror),o.onload=a.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(y=b.g.location+"");var d,y,v=b.g.document;if(!y&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(y=v.currentScript.src),!y)){var m=v.getElementsByTagName("script");if(m.length)for(var g=m.length-1;g>-1&&(!y||!/^http(s?):/.test(y));)y=m[g--].src}if(!y)throw Error("Automatic publicPath is not supported in this browser");b.p=y.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),l={889:0},b.f.j=function(e,t){var n=b.o(l,e)?l[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=l[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(l,e)&&(0!==(n=l[e])&&(l[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)}},a=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==l[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);u&&u(b)}for(e&&e(t);c<o.length;c++)r=o[c],b.o(l,r)&&l[r]&&l[r][0](),l[r]=0},(f=self.webpackChunk_nocobase_plugin_block_comment_client_v2=self.webpackChunk_nocobase_plugin_block_comment_client_v2||[]).forEach(a.bind(null,0)),f.push=a.bind(null,f.push.bind(f));var h={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-block-comment/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-block-comment/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var u=window.location.pathname||"/",c=u.indexOf(i);e=c>=0?u.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-block-comment/dist/client-v2/"}b.p=e}(),!function(){b.r(h),b.d(h,{default:function(){return l}});var e=b(485),t=b(376);function n(e,t,n,r,o,i,u){try{var c=e[i](u),l=c.value}catch(e){n(e);return}c.done?t(l):Promise.resolve(l).then(r,o)}function r(e,t,n){return(r=c()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=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 r(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)})(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var l=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function u(){var e,t;if(!(this instanceof u))throw TypeError("Cannot call a class as a function");return e=u,t=arguments,e=o(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">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,c()?Reflect.construct(e,t||[],o(this).constructor):e.apply(this,t))}return u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),e&&i(u,e),r=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:l(0)}),c(u,"throw",{value:l(1)}),c(u,"return",{value:l(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function l(c){return function(l){var a=[c,l];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)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 i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}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 this.flowEngine.flowSettings.registerComponents({RecordCommentFieldSelect:t.J}),this.flowEngine.registerModelLoaders({RecordCommentsBlockModel:{loader:function(){return b.e("41").then(b.bind(b,672))}},RecordCommentItemModel:{loader:function(){return b.e("41").then(b.bind(b,672))}},RecordCommentActionGroupModel:{loader:function(){return b.e("487").then(b.bind(b,474))}},RecordCommentSubmitActionGroupModel:{loader:function(){return b.e("487").then(b.bind(b,474))}},EditRecordCommentActionModel:{loader:function(){return b.e("487").then(b.bind(b,474))}},DeleteRecordCommentActionModel:{loader:function(){return b.e("487").then(b.bind(b,474))}},QuoteReplyRecordCommentActionModel:{loader:function(){return b.e("487").then(b.bind(b,474))}}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(o,i){var u=e.apply(t,r);function c(e){n(u,o,i,c,l,"next",e)}function l(e){n(u,o,i,c,l,"throw",e)}c(void 0)})}).call(this)}}],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)}}(u.prototype,r),u}(u(e.Plugin))}(),h}()});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NAMESPACE = "@nocobase/plugin-block-comment";
|
|
10
|
+
export declare function useT(): (str: string, options?: Record<string, unknown>) => string;
|
|
11
|
+
export declare function tExpr(key: string, options?: Record<string, unknown>): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { CollectionBlockModel, type DetailsGridModel } from '@nocobase/client-v2';
|
|
10
|
+
import { FlowModel, MultiRecordResource, type Collection } from '@nocobase/flow-engine';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { type RecordCommentFieldMapping, type RecordCommentRecord } from './utils';
|
|
13
|
+
type RecordCommentsBlockStructure = {
|
|
14
|
+
subModels: {
|
|
15
|
+
items: RecordCommentItemModel[];
|
|
16
|
+
submitActions?: FlowModel[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type RecordCommentItemStructure = {
|
|
20
|
+
subModels: {
|
|
21
|
+
bodyFields: DetailsGridModel;
|
|
22
|
+
actions: FlowModel[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare class RecordCommentItemModel extends FlowModel<RecordCommentItemStructure> {
|
|
26
|
+
render(): React.JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export declare class RecordCommentsBlockModel extends CollectionBlockModel<RecordCommentsBlockStructure> {
|
|
29
|
+
static scene: import("@nocobase/client-v2").BlockSceneType;
|
|
30
|
+
_defaultCustomModelClasses: {
|
|
31
|
+
DetailsItemModel: string;
|
|
32
|
+
DetailsAssociationFieldGroupModel: string;
|
|
33
|
+
DetailsCustomItemModel: string;
|
|
34
|
+
};
|
|
35
|
+
private readonly resolvedOwnerValue;
|
|
36
|
+
private readonly loadingLastPage;
|
|
37
|
+
private shouldLoadLastPage;
|
|
38
|
+
static filterCollection(collection: Collection): boolean;
|
|
39
|
+
get resource(): MultiRecordResource<RecordCommentRecord>;
|
|
40
|
+
get mapping(): RecordCommentFieldMapping;
|
|
41
|
+
private getOwnerValueFromRecord;
|
|
42
|
+
private get currentViewInputArgs();
|
|
43
|
+
private get currentViewCollection();
|
|
44
|
+
private getOwnerValueFromViewFilterByTk;
|
|
45
|
+
private get rawOwnerValue();
|
|
46
|
+
private get ownerFilterValueState();
|
|
47
|
+
get ownerValue(): string | number | boolean;
|
|
48
|
+
resolveOwnerValue(): Promise<string | number | boolean>;
|
|
49
|
+
applyOwnerFilter(): Promise<void>;
|
|
50
|
+
createResource(): MultiRecordResource<RecordCommentRecord>;
|
|
51
|
+
getLastPage(pageSize?: any): number;
|
|
52
|
+
shouldAutoJumpToLastPage(): boolean;
|
|
53
|
+
isPreparingLastPageLoad(): boolean;
|
|
54
|
+
ensureLastPageLoaded(): Promise<void>;
|
|
55
|
+
handlePageChange(page: number): Promise<void>;
|
|
56
|
+
renderComponent(): React.JSX.Element;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ButtonProps } from 'antd/es/button';
|
|
10
|
+
import { RecordCommentActionModel } from './RecordCommentActionGroupModel';
|
|
11
|
+
export declare class DeleteRecordCommentActionModel extends RecordCommentActionModel {
|
|
12
|
+
static scene: import("@nocobase/client-v2").ActionSceneType;
|
|
13
|
+
defaultProps: ButtonProps;
|
|
14
|
+
getAclActionName(): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ButtonProps } from 'antd/es/button';
|
|
10
|
+
import { RecordCommentActionModel } from './RecordCommentActionGroupModel';
|
|
11
|
+
export declare class EditRecordCommentActionModel extends RecordCommentActionModel {
|
|
12
|
+
static scene: import("@nocobase/client-v2").ActionSceneType;
|
|
13
|
+
defaultProps: ButtonProps;
|
|
14
|
+
getAclActionName(): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { ButtonProps } from 'antd/es/button';
|
|
10
|
+
import { RecordCommentActionModel } from './RecordCommentActionGroupModel';
|
|
11
|
+
export declare class QuoteReplyRecordCommentActionModel extends RecordCommentActionModel {
|
|
12
|
+
static scene: import("@nocobase/client-v2").ActionSceneType;
|
|
13
|
+
defaultProps: ButtonProps;
|
|
14
|
+
getAclActionName(): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { ActionGroupModel, ActionModel } from '@nocobase/client-v2';
|
|
10
|
+
import { type FlowModelContext } from '@nocobase/flow-engine';
|
|
11
|
+
export declare class RecordCommentActionModel extends ActionModel {
|
|
12
|
+
}
|
|
13
|
+
export declare class RecordCommentActionGroupModel extends ActionGroupModel {
|
|
14
|
+
static baseClass: typeof RecordCommentActionModel;
|
|
15
|
+
static defineChildren(ctx: FlowModelContext): Promise<any[]>;
|
|
16
|
+
}
|
|
17
|
+
export declare class RecordCommentSubmitActionGroupModel extends ActionGroupModel {
|
|
18
|
+
static defineChildren(ctx: FlowModelContext): Promise<any[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export * from './DeleteRecordCommentActionModel';
|
|
10
|
+
export * from './EditRecordCommentActionModel';
|
|
11
|
+
export * from './RecordCommentActionGroupModel';
|
|
12
|
+
export * from './QuoteReplyRecordCommentActionModel';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { RecordCommentsBlockModel } from '../RecordCommentsBlockModel';
|
|
12
|
+
import type { RecordCommentRecord } from '../utils';
|
|
13
|
+
export declare const RecordCommentActions: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<{
|
|
14
|
+
blockModel: RecordCommentsBlockModel;
|
|
15
|
+
record: RecordCommentRecord;
|
|
16
|
+
itemModel: FlowModel;
|
|
17
|
+
forkKeyPrefix: string;
|
|
18
|
+
setEditing: () => void;
|
|
19
|
+
}>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { SelectProps } from 'antd';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export declare const RecordCommentFieldSelect: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<SelectProps<string | string[], import("rc-select/lib/Select").DefaultOptionType>, "options"> & {
|
|
12
|
+
value?: string | string[];
|
|
13
|
+
onChange?: (value: string | string[] | undefined) => void;
|
|
14
|
+
fieldFilter?: 'content' | 'date' | 'owner' | 'user';
|
|
15
|
+
}>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { RecordCommentsBlockModel } from '../RecordCommentsBlockModel';
|
|
12
|
+
import { type RecordCommentRecord } from '../utils';
|
|
13
|
+
export declare const RecordCommentsBlockView: React.NamedExoticComponent<Omit<{
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}, "model" | "dataSource" | "onPageChange"> & {
|
|
16
|
+
model: RecordCommentsBlockModel;
|
|
17
|
+
dataSource: RecordCommentRecord[];
|
|
18
|
+
onPageChange: (page: number) => void;
|
|
19
|
+
} & {
|
|
20
|
+
children?: any;
|
|
21
|
+
}> & {
|
|
22
|
+
readonly type: import("@formily/reactive-react").ReactFC<{
|
|
23
|
+
model: RecordCommentsBlockModel;
|
|
24
|
+
dataSource: RecordCommentRecord[];
|
|
25
|
+
onPageChange: (page: number) => void;
|
|
26
|
+
}>;
|
|
27
|
+
} & {
|
|
28
|
+
Item: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<{
|
|
29
|
+
blockModel: RecordCommentsBlockModel;
|
|
30
|
+
itemModel: FlowModel;
|
|
31
|
+
record: RecordCommentRecord;
|
|
32
|
+
forkKeyPrefix: string;
|
|
33
|
+
}>>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getErrorMessage: (error: unknown, fallback: string) => string;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export type RecordCommentRecord = {
|
|
10
|
+
id?: string | number;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type RecordCommentFieldMapping = {
|
|
14
|
+
commenterField?: string;
|
|
15
|
+
dateField?: string;
|
|
16
|
+
contentField?: string;
|
|
17
|
+
ownerField?: string;
|
|
18
|
+
ownerValueField?: unknown;
|
|
19
|
+
};
|
|
20
|
+
export type DefaultRecordCommentFieldMapping = Pick<RecordCommentFieldMapping, 'ownerField' | 'ownerValueField'>;
|
|
21
|
+
export type RecordCommentAssociationLike = {
|
|
22
|
+
collection?: {
|
|
23
|
+
name?: string;
|
|
24
|
+
};
|
|
25
|
+
foreignKey?: string;
|
|
26
|
+
sourceKey?: string;
|
|
27
|
+
};
|
|
28
|
+
export type RecordCommentCollection = {
|
|
29
|
+
filterTargetKey?: string | string[];
|
|
30
|
+
getFilterByTK?: (record: RecordCommentRecord) => unknown;
|
|
31
|
+
getField?: (fieldName: string) => RecordCommentCollectionField | undefined;
|
|
32
|
+
getFields?: () => RecordCommentCollectionField[];
|
|
33
|
+
fields?: RecordCommentCollectionField[] | Map<string, RecordCommentCollectionField>;
|
|
34
|
+
options?: {
|
|
35
|
+
fields?: RecordCommentCollectionField[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type RecordCommentCollectionField = {
|
|
39
|
+
name?: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
interface?: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
target?: string;
|
|
44
|
+
primaryKey?: boolean;
|
|
45
|
+
targetKey?: string;
|
|
46
|
+
targetCollection?: RecordCommentCollection & {
|
|
47
|
+
name?: string;
|
|
48
|
+
};
|
|
49
|
+
uiSchema?: {
|
|
50
|
+
title?: string;
|
|
51
|
+
['x-component-props']?: Record<string, unknown>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type RecordCommentOwnerValueContext = {
|
|
55
|
+
record?: RecordCommentRecord;
|
|
56
|
+
resolveJsonTemplate?: (template: string) => Promise<unknown>;
|
|
57
|
+
};
|
|
58
|
+
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
59
|
+
export declare const OWNER_FILTER_GROUP_KEY = "record-comments-owner";
|
|
60
|
+
export declare const COMMENT_OWNER_VARIABLE_EXAMPLE = "{{ ctx.record.id }}";
|
|
61
|
+
export declare const COMMENT_OWNER_FILTER_BY_TK_VARIABLE = "{{ ctx.view.inputArgs.filterByTk }}";
|
|
62
|
+
export declare const getCollectionFields: (collection?: unknown) => RecordCommentCollectionField[];
|
|
63
|
+
export declare const getCollectionField: (collection: unknown, fieldName?: string) => RecordCommentCollectionField;
|
|
64
|
+
export declare const getCollectionFieldOptions: (collection?: unknown) => {
|
|
65
|
+
label: string;
|
|
66
|
+
value: string;
|
|
67
|
+
}[];
|
|
68
|
+
export declare const isCommentContentField: (field?: RecordCommentCollectionField) => boolean;
|
|
69
|
+
export declare const isCommentDateField: (field?: RecordCommentCollectionField) => boolean;
|
|
70
|
+
export declare const getCommentContentFieldOptions: (collection?: unknown) => {
|
|
71
|
+
label: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}[];
|
|
74
|
+
export declare const getCommentDateFieldOptions: (collection?: unknown) => {
|
|
75
|
+
label: string;
|
|
76
|
+
value: string;
|
|
77
|
+
}[];
|
|
78
|
+
export declare const isBelongsToField: (field?: RecordCommentCollectionField) => boolean;
|
|
79
|
+
export declare const isCommentOwnerField: (field?: RecordCommentCollectionField) => boolean;
|
|
80
|
+
export declare const isUserField: (field?: RecordCommentCollectionField) => boolean;
|
|
81
|
+
export declare const getCommentOwnerFieldOptions: (collection?: unknown) => {
|
|
82
|
+
label: string;
|
|
83
|
+
value: string;
|
|
84
|
+
}[];
|
|
85
|
+
export declare const getCommentUserFieldOptions: (collection?: unknown) => {
|
|
86
|
+
label: string;
|
|
87
|
+
value: string;
|
|
88
|
+
}[];
|
|
89
|
+
export declare const getDefaultRecordCommentFieldMapping: (options: {
|
|
90
|
+
collection?: unknown;
|
|
91
|
+
currentCollectionName?: string;
|
|
92
|
+
}) => DefaultRecordCommentFieldMapping;
|
|
93
|
+
export declare const getAssociationSourceCollectionName: (options: {
|
|
94
|
+
association?: RecordCommentAssociationLike;
|
|
95
|
+
associationName?: string;
|
|
96
|
+
}) => string;
|
|
97
|
+
export declare const getAssociationRecordCommentFieldMapping: (options: {
|
|
98
|
+
collection?: unknown;
|
|
99
|
+
association?: RecordCommentAssociationLike;
|
|
100
|
+
associationName?: string;
|
|
101
|
+
sourceId?: unknown;
|
|
102
|
+
}) => DefaultRecordCommentFieldMapping;
|
|
103
|
+
export declare const getCollectionFilterTargetKey: (collection?: unknown) => string;
|
|
104
|
+
export declare const getRecordPrimaryKeyValue: (record?: RecordCommentRecord, collection?: unknown) => string | number | undefined;
|
|
105
|
+
export declare const getValueByPath: (record: RecordCommentRecord | undefined, path?: unknown) => unknown;
|
|
106
|
+
export declare const isContextVariableExpression: (value?: unknown) => boolean;
|
|
107
|
+
export declare const isContextVariablePath: (value?: unknown) => boolean;
|
|
108
|
+
export declare const isContextVariableValue: (value?: unknown) => boolean;
|
|
109
|
+
export declare const normalizeContextVariableTemplate: (value?: unknown) => string;
|
|
110
|
+
export declare const toScalarFilterValue: (value: unknown) => string | number | boolean | undefined;
|
|
111
|
+
export declare const normalizeOwnerFilterValue: (collection: unknown, ownerFieldName: string, ownerValue: string | number | boolean) => {
|
|
112
|
+
compatible: boolean;
|
|
113
|
+
value: string | number | boolean;
|
|
114
|
+
} | {
|
|
115
|
+
compatible: boolean;
|
|
116
|
+
value?: undefined;
|
|
117
|
+
};
|
|
118
|
+
export declare const resolveCommentOwnerValueFromFilterByTk: (ownerValueField: unknown, filterByTk: unknown, currentRecordTargetKey?: string) => string | number | boolean;
|
|
119
|
+
export declare const createOwnerFieldFilter: (collection: unknown, ownerFieldName: string, ownerValue: string | number | boolean) => {
|
|
120
|
+
[x: string]: {
|
|
121
|
+
[x: string]: {
|
|
122
|
+
$eq: string | number | boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
} | {
|
|
126
|
+
[x: string]: {
|
|
127
|
+
$eq: string | number | boolean;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export declare const resolveCommentOwnerValue: (context: RecordCommentOwnerValueContext, ownerValueField?: unknown) => Promise<string | number | boolean>;
|
|
131
|
+
export declare const getDisplayValue: (value: unknown) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin } from '@nocobase/client-v2';
|
|
10
|
+
export declare class PluginRecordCommentsClientV2 extends Plugin {
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export default PluginRecordCommentsClientV2;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
"@nocobase/flow-engine": "2.2.0-alpha.4",
|
|
12
|
+
"@nocobase/client": "2.2.0-alpha.4",
|
|
13
|
+
"@nocobase/client-v2": "2.2.0-alpha.4",
|
|
14
|
+
"@nocobase/server": "2.2.0-alpha.4",
|
|
15
|
+
"@formily/reactive": "2.3.7",
|
|
16
|
+
"antd": "5.24.2",
|
|
17
|
+
"react": "18.2.0",
|
|
18
|
+
"@ant-design/icons": "5.6.1",
|
|
19
|
+
"@emotion/css": "11.13.0",
|
|
20
|
+
"@nocobase/utils": "2.2.0-alpha.4"
|
|
21
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export * from './server';
|
|
10
|
+
export { default } from './server';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __create = Object.create;
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __export = (target, all) => {
|
|
17
|
+
for (var name in all)
|
|
18
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var src_exports = {};
|
|
39
|
+
__export(src_exports, {
|
|
40
|
+
default: () => import_server.default
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(src_exports);
|
|
43
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
44
|
+
var import_server = __toESM(require("./server"));
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
...require("./server")
|
|
48
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "Actions",
|
|
3
|
+
"Auto jump to last page": "Auto jump to last page",
|
|
4
|
+
"Are you sure you want to delete it?": "Are you sure you want to delete it?",
|
|
5
|
+
"Cancel": "Cancel",
|
|
6
|
+
"Comment": "Comment",
|
|
7
|
+
"Comment content": "Comment content",
|
|
8
|
+
"Comment content field": "Comment content field",
|
|
9
|
+
"Comment date field": "Comment date field",
|
|
10
|
+
"Commenter field": "Commenter field",
|
|
11
|
+
"Comment owner field": "Comment owner field",
|
|
12
|
+
"Comment owner field value": "Comment owner field value",
|
|
13
|
+
"Current record field": "Current record field",
|
|
14
|
+
"Delete": "Delete",
|
|
15
|
+
"Delete record": "Delete record",
|
|
16
|
+
"Delete settings": "Delete settings",
|
|
17
|
+
"Edit": "Edit",
|
|
18
|
+
"Failed to create comment": "Failed to create comment",
|
|
19
|
+
"Failed to delete comment": "Failed to delete comment",
|
|
20
|
+
"Failed to update comment": "Failed to update comment",
|
|
21
|
+
"Field mapping": "Field mapping",
|
|
22
|
+
"Jump to last page by default": "Jump to last page by default",
|
|
23
|
+
"Record comment action": "Comment action",
|
|
24
|
+
"Comments": "Comments",
|
|
25
|
+
"Record comments settings": "Block: Comment settings",
|
|
26
|
+
"No comments": "No comments",
|
|
27
|
+
"No resource or record selected for deletion": "No resource or record selected for deletion",
|
|
28
|
+
"Page size": "Page size",
|
|
29
|
+
"Only many-to-one fields associated with the users collection can be selected.": "Only many-to-one fields associated with the users collection can be selected.",
|
|
30
|
+
"Please configure the comment content field, commenter field, comment owner field, and comment date field.": "Please configure the comment content field, commenter field, comment owner field, and comment date field.",
|
|
31
|
+
"Quote reply": "Quote reply",
|
|
32
|
+
"Record deleted successfully": "Record deleted successfully",
|
|
33
|
+
"Render error": "Render error",
|
|
34
|
+
"Search": "Search",
|
|
35
|
+
"Select field": "Select field",
|
|
36
|
+
"Specify the associated business record value, for example the current record ID.": "Specify the associated business record value, for example the current record ID.",
|
|
37
|
+
"The comment owner field value type does not match the comment owner field. Please reconfigure the field mapping.": "The comment owner field value type does not match the comment owner field. Please reconfigure the field mapping.",
|
|
38
|
+
"The current record value is empty, so comments cannot be loaded.": "The current record value is empty, so comments cannot be loaded.",
|
|
39
|
+
"Update Comment": "Update Comment"
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Actions": "操作",
|
|
3
|
+
"Auto jump to last page": "自动跳转到最后一页",
|
|
4
|
+
"Are you sure you want to delete it?": "确定要删除吗?",
|
|
5
|
+
"Cancel": "取消",
|
|
6
|
+
"Comment": "评论",
|
|
7
|
+
"Comment content": "评论内容",
|
|
8
|
+
"Comment content field": "评论内容字段",
|
|
9
|
+
"Comment date field": "评论日期字段",
|
|
10
|
+
"Commenter field": "评论人字段",
|
|
11
|
+
"Comment owner field": "评论归属字段",
|
|
12
|
+
"Comment owner field value": "评论归属字段值",
|
|
13
|
+
"Current record field": "当前记录字段",
|
|
14
|
+
"Delete": "删除",
|
|
15
|
+
"Delete record": "删除记录",
|
|
16
|
+
"Delete settings": "删除设置",
|
|
17
|
+
"Edit": "编辑",
|
|
18
|
+
"Failed to create comment": "创建评论失败",
|
|
19
|
+
"Failed to delete comment": "删除评论失败",
|
|
20
|
+
"Failed to update comment": "更新评论失败",
|
|
21
|
+
"Field mapping": "字段映射",
|
|
22
|
+
"Jump to last page by default": "默认跳转到最后一页",
|
|
23
|
+
"Record comment action": "评论操作",
|
|
24
|
+
"Comments": "评论",
|
|
25
|
+
"Record comments settings": "区块:评论设置",
|
|
26
|
+
"No comments": "暂无评论",
|
|
27
|
+
"No resource or record selected for deletion": "未选择资源或记录,无法删除",
|
|
28
|
+
"Page size": "每页条数",
|
|
29
|
+
"Only many-to-one fields associated with the users collection can be selected.": "仅可选择关联用户表的多对一字段。",
|
|
30
|
+
"Please configure the comment content field, commenter field, comment owner field, and comment date field.": "请配置评论内容字段、评论人字段、评论归属字段和评论日期字段。",
|
|
31
|
+
"Quote reply": "引用并回复",
|
|
32
|
+
"Record deleted successfully": "记录已删除",
|
|
33
|
+
"Render error": "渲染错误",
|
|
34
|
+
"Search": "搜索",
|
|
35
|
+
"Select field": "选择字段",
|
|
36
|
+
"Specify the associated business record value, for example the current record ID.": "指定关联业务记录值,例如当前记录 ID。",
|
|
37
|
+
"The comment owner field value type does not match the comment owner field. Please reconfigure the field mapping.": "评论归属字段值的数据类型与评论归属字段不匹配,请重新配置字段映射。",
|
|
38
|
+
"The current record value is empty, so comments cannot be loaded.": "当前记录值为空,无法加载评论。",
|
|
39
|
+
"Update Comment": "更新评论"
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default } from './plugin';
|