@nocobase/plugin-block-markdown 2.1.0-alpha.10 → 2.1.0-alpha.11
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 +1 -1
- package/dist/externalVersion.js +3 -3
- package/dist/server/flow-schema-contributions/index.d.ts +10 -0
- package/dist/server/flow-schema-contributions/index.js +108 -0
- package/dist/server/plugin.d.ts +2 -0
- package/dist/server/plugin.js +4 -0
- package/package.json +2 -2
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("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-block-markdown",["@nocobase/client","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-markdown"]=t(require("@nocobase/client"),require("@nocobase/flow-engine")):e["@nocobase/plugin-block-markdown"]=t(e["@nocobase/client"],e["@nocobase/flow-engine"])}(self,function(e,t){return function(){"use strict";var n
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-block-markdown",["@nocobase/client","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-block-markdown"]=t(require("@nocobase/client"),require("@nocobase/flow-engine")):e["@nocobase/plugin-block-markdown"]=t(e["@nocobase/client"],e["@nocobase/flow-engine"])}(self,function(e,t){return function(){"use strict";var n={342:function(t){t.exports=e},694:function(e){e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var c=r[e]={exports:{}};return n[e](c,c.exports,o),c.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.g.importScripts&&(c=o.g.location+"");var c,i=o.g.document;if(!c&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(c=i.currentScript.src),!c)){var a=i.getElementsByTagName("script");if(a.length)for(var u=a.length-1;u>-1&&(!c||!/^http(s?):/.test(c));)c=a[u--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");o.p=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var l={},f=window.__nocobase_public_path__||"";if(!f&&window.location&&window.location.pathname){var s=window.location.pathname||"/",p=s.indexOf("/v2/");f=p>=0?s.slice(0,p+1):"/"}return f&&(f=f.replace(/\/v2\/?$/,"/")),f||(f="/"),"/"!==f.charAt(f.length-1)&&(f+="/"),o.p=f+"static/plugins/@nocobase/plugin-block-markdown/dist/client/",!function(){o.r(l),o.d(l,{MarkdownBlockModel:function(){return i},default:function(){return d}});var e=o(342),t=o(694);function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var i=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t,r,i,a;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,r=arguments,t=n(t),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(t,r||[],n(this).constructor):t.apply(this,r)),a=void 0,(i="_previousStepParams")in e?Object.defineProperty(e,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[i]=a,e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&r(o,e),t=[{key:"renderComponent",value:function(){return this.props.content}}],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)}}(o.prototype,t),o}(e.BlockModel);function a(e,t,n,r,o,c,i){try{var a=e[c](i),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function u(e,t,n){return(u=y()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&p(o,n.prototype),o}).apply(null,arguments)}i.define({label:(0,t.escapeT)("Markdown")}),i.registerFlow(e.editMarkdownFlow);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){var t="function"==typeof Map?new Map:void 0;return(b=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 u(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),p(n,e)})(e)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}var d=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=s(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,y()?Reflect.construct(e,t||[],s(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&p(n,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(i,"next",{value:u(0)}),a(i,"throw",{value:u(1)}),a(i,"return",{value:u(2)}),"function"==typeof Symbol&&a(i,Symbol.iterator,{value:function(){return this}}),i;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,r=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){c=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){c.label=l[1];break}if(6===l[0]&&c.label<o[1]){c.label=o[1],o=l;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(l);break}o[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.flowEngine.registerModels({MarkdownBlockModel:i}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var c=e.apply(t,n);function i(e){a(c,r,o,i,u,"next",e)}function u(e){a(c,r,o,i,u,"throw",e)}i(void 0)})}).call(this)}},{key:"getCDN",value:function(){return this.app.getPublicPath()+"static/plugins/@nocobase/plugin-block-markdown/dist/client/vditor"}},{key:"initVditorDependency",value:function(){var e=this,t=this.getCDN();try{var n,r="plugin-block-markdown-dep",o=(n={},f(n,"".concat(r,".katex"),"".concat(t,"/dist/js/katex/katex.min.js?v=0.16.9")),f(n,"".concat(r,".ABCJS"),"".concat(t,"/dist/js/abcjs/abcjs_basic.min")),f(n,"".concat(r,".plantumlEncoder"),"".concat(t,"/dist/js/plantuml/plantuml-encoder.min")),f(n,"".concat(r,".echarts"),"".concat(t,"/dist/js/echarts/echarts.min")),f(n,"".concat(r,".flowchart"),"".concat(t,"/dist/js/flowchart.js/flowchart.min")),f(n,"".concat(r,".Viz"),"".concat(t,"/dist/js/graphviz/viz")),f(n,"".concat(r,".mermaid"),"".concat(t,"/dist/js/mermaid/mermaid.min")),n);this.app.requirejs.require.config({waitSeconds:120,paths:o}),Object.keys(o).forEach(function(t){e.app.requirejs.require([t],function(e){window[t.split(".")[1]]=e})})}catch(e){console.log("initVditorDependency failed",e)}}}],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}(b(e.Plugin))}(),l}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/flow-engine": "2.1.0-alpha.
|
|
12
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
13
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/flow-engine": "2.1.0-alpha.11",
|
|
12
|
+
"@nocobase/client": "2.1.0-alpha.11",
|
|
13
|
+
"@nocobase/server": "2.1.0-alpha.11"
|
|
14
14
|
};
|
|
@@ -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
|
+
import type { FlowSchemaContribution } from '@nocobase/flow-engine';
|
|
10
|
+
export declare const flowSchemaContribution: FlowSchemaContribution;
|
|
@@ -0,0 +1,108 @@
|
|
|
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 __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var flow_schema_contributions_exports = {};
|
|
28
|
+
__export(flow_schema_contributions_exports, {
|
|
29
|
+
flowSchemaContribution: () => flowSchemaContribution
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(flow_schema_contributions_exports);
|
|
32
|
+
const markdownBlockModelSchemaContribution = {
|
|
33
|
+
use: "MarkdownBlockModel",
|
|
34
|
+
title: "Markdown block",
|
|
35
|
+
source: "plugin",
|
|
36
|
+
strict: false,
|
|
37
|
+
stepParamsSchema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
markdownBlockSettings: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
editMarkdown: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
content: {
|
|
47
|
+
type: "string"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
required: ["content"],
|
|
51
|
+
additionalProperties: false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
additionalProperties: true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
additionalProperties: true
|
|
58
|
+
},
|
|
59
|
+
skeleton: {
|
|
60
|
+
uid: "todo-markdown-block-uid",
|
|
61
|
+
use: "MarkdownBlockModel",
|
|
62
|
+
stepParams: {
|
|
63
|
+
markdownBlockSettings: {
|
|
64
|
+
editMarkdown: {
|
|
65
|
+
content: "This is a demo text, **supports Markdown syntax**."
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
docs: {
|
|
71
|
+
minimalExample: {
|
|
72
|
+
uid: "markdown-intro",
|
|
73
|
+
use: "MarkdownBlockModel",
|
|
74
|
+
stepParams: {
|
|
75
|
+
markdownBlockSettings: {
|
|
76
|
+
editMarkdown: {
|
|
77
|
+
content: "# Welcome"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
dynamicHints: [
|
|
83
|
+
{
|
|
84
|
+
kind: "dynamic-ui-schema",
|
|
85
|
+
path: "MarkdownBlockModel.stepParams.markdownBlockSettings.editMarkdown.content",
|
|
86
|
+
message: "Markdown content can contain liquid variables resolved against the runtime flow context.",
|
|
87
|
+
"x-flow": {
|
|
88
|
+
contextRequirements: ["liquid variables", "markdown renderer"],
|
|
89
|
+
unresolvedReason: "runtime-markdown-context",
|
|
90
|
+
recommendedFallback: "# Welcome"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const flowSchemaContribution = {
|
|
97
|
+
inventory: {
|
|
98
|
+
publicTreeRoots: ["MarkdownBlockModel"]
|
|
99
|
+
},
|
|
100
|
+
models: [markdownBlockModelSchemaContribution],
|
|
101
|
+
defaults: {
|
|
102
|
+
source: "plugin"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
106
|
+
0 && (module.exports = {
|
|
107
|
+
flowSchemaContribution
|
|
108
|
+
});
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import type { FlowSchemaContribution } from '@nocobase/flow-engine';
|
|
9
10
|
import { Plugin } from '@nocobase/server';
|
|
10
11
|
export declare class PluginBlockMarkdownServer extends Plugin {
|
|
12
|
+
getFlowSchemaContributions(): FlowSchemaContribution;
|
|
11
13
|
afterAdd(): Promise<void>;
|
|
12
14
|
beforeLoad(): Promise<void>;
|
|
13
15
|
load(): Promise<void>;
|
package/dist/server/plugin.js
CHANGED
|
@@ -31,7 +31,11 @@ __export(plugin_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(plugin_exports);
|
|
33
33
|
var import_server = require("@nocobase/server");
|
|
34
|
+
var import_flow_schema_contributions = require("./flow-schema-contributions");
|
|
34
35
|
class PluginBlockMarkdownServer extends import_server.Plugin {
|
|
36
|
+
getFlowSchemaContributions() {
|
|
37
|
+
return import_flow_schema_contributions.flowSchemaContribution;
|
|
38
|
+
}
|
|
35
39
|
async afterAdd() {
|
|
36
40
|
}
|
|
37
41
|
async beforeLoad() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-block-markdown",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.11",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Block: Markdown",
|
|
6
6
|
"displayName.zh-CN": "Markdown",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"keywords": [
|
|
18
18
|
"Blocks"
|
|
19
19
|
],
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "bb96d633a6371afb586072ff516bd0613c757db0"
|
|
21
21
|
}
|