@flowgram.ai/select-box-plugin 0.1.1
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/esm/index.js +20 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/create-select-box-plugin.ts
|
|
2
|
+
import {
|
|
3
|
+
FlowSelectorBoundsLayer,
|
|
4
|
+
FlowSelectorBoxLayer
|
|
5
|
+
} from "@flowgram.ai/renderer";
|
|
6
|
+
import { definePluginCreator } from "@flowgram.ai/core";
|
|
7
|
+
var createSelectBoxPlugin = definePluginCreator({
|
|
8
|
+
onInit(ctx, opts) {
|
|
9
|
+
if (opts.enable !== false) {
|
|
10
|
+
ctx.playground.registerLayer(FlowSelectorBoundsLayer, opts);
|
|
11
|
+
ctx.playground.registerLayer(FlowSelectorBoxLayer, {
|
|
12
|
+
canSelect: opts.canSelect
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
createSelectBoxPlugin
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/create-select-box-plugin.ts"],"sourcesContent":["import {\n FlowSelectorBoundsLayer,\n FlowSelectorBoundsLayerOptions,\n FlowSelectorBoxLayer,\n FlowSelectorBoxOptions,\n type SelectorBoxPopoverProps,\n} from '@flowgram.ai/renderer';\nimport { definePluginCreator } from '@flowgram.ai/core';\n\n// import { SelectorBounds } from './selector-bounds';\n\nexport { type SelectorBoxPopoverProps };\nexport interface SelectBoxPluginOptions\n extends FlowSelectorBoundsLayerOptions,\n FlowSelectorBoxOptions {\n enable?: boolean;\n}\n\nexport const createSelectBoxPlugin = definePluginCreator<SelectBoxPluginOptions>({\n onInit(ctx, opts): void {\n // 默认可用,所以强制判断 false\n if (opts.enable !== false) {\n ctx.playground.registerLayer<FlowSelectorBoundsLayer>(FlowSelectorBoundsLayer, opts);\n ctx.playground.registerLayer<FlowSelectorBoxLayer>(FlowSelectorBoxLayer, {\n canSelect: opts.canSelect,\n });\n }\n },\n});\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OAGK;AACP,SAAS,2BAA2B;AAW7B,IAAM,wBAAwB,oBAA4C;AAAA,EAC/E,OAAO,KAAK,MAAY;AAEtB,QAAI,KAAK,WAAW,OAAO;AACzB,UAAI,WAAW,cAAuC,yBAAyB,IAAI;AACnF,UAAI,WAAW,cAAoC,sBAAsB;AAAA,QACvE,WAAW,KAAK;AAAA,MAClB,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;","names":[]}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
2
|
+
import { FlowSelectorBoundsLayerOptions, FlowSelectorBoxOptions } from '@flowgram.ai/renderer';
|
|
3
|
+
export { SelectorBoxPopoverProps } from '@flowgram.ai/renderer';
|
|
4
|
+
|
|
5
|
+
interface SelectBoxPluginOptions extends FlowSelectorBoundsLayerOptions, FlowSelectorBoxOptions {
|
|
6
|
+
enable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const createSelectBoxPlugin: _flowgram_ai_core.PluginCreator<SelectBoxPluginOptions>;
|
|
9
|
+
|
|
10
|
+
export { type SelectBoxPluginOptions, createSelectBoxPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
2
|
+
import { FlowSelectorBoundsLayerOptions, FlowSelectorBoxOptions } from '@flowgram.ai/renderer';
|
|
3
|
+
export { SelectorBoxPopoverProps } from '@flowgram.ai/renderer';
|
|
4
|
+
|
|
5
|
+
interface SelectBoxPluginOptions extends FlowSelectorBoundsLayerOptions, FlowSelectorBoxOptions {
|
|
6
|
+
enable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const createSelectBoxPlugin: _flowgram_ai_core.PluginCreator<SelectBoxPluginOptions>;
|
|
9
|
+
|
|
10
|
+
export { type SelectBoxPluginOptions, createSelectBoxPlugin };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
createSelectBoxPlugin: () => createSelectBoxPlugin
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
|
|
27
|
+
// src/create-select-box-plugin.ts
|
|
28
|
+
var import_renderer = require("@flowgram.ai/renderer");
|
|
29
|
+
var import_core = require("@flowgram.ai/core");
|
|
30
|
+
var createSelectBoxPlugin = (0, import_core.definePluginCreator)({
|
|
31
|
+
onInit(ctx, opts) {
|
|
32
|
+
if (opts.enable !== false) {
|
|
33
|
+
ctx.playground.registerLayer(import_renderer.FlowSelectorBoundsLayer, opts);
|
|
34
|
+
ctx.playground.registerLayer(import_renderer.FlowSelectorBoxLayer, {
|
|
35
|
+
canSelect: opts.canSelect
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
createSelectBoxPlugin
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/create-select-box-plugin.ts"],"sourcesContent":["export * from './create-select-box-plugin';\n","import {\n FlowSelectorBoundsLayer,\n FlowSelectorBoundsLayerOptions,\n FlowSelectorBoxLayer,\n FlowSelectorBoxOptions,\n type SelectorBoxPopoverProps,\n} from '@flowgram.ai/renderer';\nimport { definePluginCreator } from '@flowgram.ai/core';\n\n// import { SelectorBounds } from './selector-bounds';\n\nexport { type SelectorBoxPopoverProps };\nexport interface SelectBoxPluginOptions\n extends FlowSelectorBoundsLayerOptions,\n FlowSelectorBoxOptions {\n enable?: boolean;\n}\n\nexport const createSelectBoxPlugin = definePluginCreator<SelectBoxPluginOptions>({\n onInit(ctx, opts): void {\n // 默认可用,所以强制判断 false\n if (opts.enable !== false) {\n ctx.playground.registerLayer<FlowSelectorBoundsLayer>(FlowSelectorBoundsLayer, opts);\n ctx.playground.registerLayer<FlowSelectorBoxLayer>(FlowSelectorBoxLayer, {\n canSelect: opts.canSelect,\n });\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,sBAMO;AACP,kBAAoC;AAW7B,IAAM,4BAAwB,iCAA4C;AAAA,EAC/E,OAAO,KAAK,MAAY;AAEtB,QAAI,KAAK,WAAW,OAAO;AACzB,UAAI,WAAW,cAAuC,yCAAyB,IAAI;AACnF,UAAI,WAAW,cAAoC,sCAAsB;AAAA,QACvE,WAAW,KAAK;AAAA,MAClB,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flowgram.ai/select-box-plugin",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"exports": {
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"import": "./dist/esm/index.js",
|
|
8
|
+
"require": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/esm/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"inversify": "^6.0.1",
|
|
18
|
+
"@flowgram.ai/renderer": "0.1.1",
|
|
19
|
+
"@flowgram.ai/core": "0.1.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/react": "^18",
|
|
23
|
+
"@types/react-dom": "^18",
|
|
24
|
+
"@vitest/coverage-v8": "^0.32.0",
|
|
25
|
+
"eslint": "^8.54.0",
|
|
26
|
+
"tsup": "^8.0.1",
|
|
27
|
+
"typescript": "^5.0.4",
|
|
28
|
+
"vitest": "^0.34.6",
|
|
29
|
+
"@flowgram.ai/eslint-config": "0.1.1",
|
|
30
|
+
"@flowgram.ai/ts-config": "0.1.1"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": ">=17",
|
|
34
|
+
"react-dom": ">=17"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "npm run build:fast -- --dts-resolve",
|
|
42
|
+
"build:fast": "tsup src/index.ts --format cjs,esm --sourcemap --legacy-output",
|
|
43
|
+
"build:watch": "npm run build:fast -- --dts-resolve",
|
|
44
|
+
"clean": "rimraf dist",
|
|
45
|
+
"test": "exit 0",
|
|
46
|
+
"test:cov": "exit 0",
|
|
47
|
+
"ts-check": "tsc --noEmit",
|
|
48
|
+
"watch": "npm run build:fast -- --dts-resolve --watch --ignore-watch dist"
|
|
49
|
+
}
|
|
50
|
+
}
|