@lofcz/platejs-slash-command 52.0.15
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 +24 -0
- package/README.md +7 -0
- package/dist/BaseSlashPlugin-CelcWowr.js +30 -0
- package/dist/BaseSlashPlugin-CelcWowr.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +10 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Ziad Beyens, Dylan Schiemann, Joe Anderson, Felix Feng
|
|
4
|
+
|
|
5
|
+
Unless otherwise specified in a LICENSE file within an individual package directory,
|
|
6
|
+
this license applies to all files in this repository outside of those package directories.
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
|
16
|
+
all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { withTriggerCombobox } from "@platejs/combobox";
|
|
2
|
+
import { KEYS, createSlatePlugin, createTSlatePlugin } from "platejs";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/BaseSlashPlugin.ts
|
|
5
|
+
const BaseSlashInputPlugin = createSlatePlugin({
|
|
6
|
+
key: KEYS.slashInput,
|
|
7
|
+
editOnly: true,
|
|
8
|
+
node: {
|
|
9
|
+
isElement: true,
|
|
10
|
+
isInline: true,
|
|
11
|
+
isVoid: true
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const BaseSlashPlugin = createTSlatePlugin({
|
|
15
|
+
key: KEYS.slashCommand,
|
|
16
|
+
editOnly: true,
|
|
17
|
+
options: {
|
|
18
|
+
trigger: "/",
|
|
19
|
+
triggerPreviousCharPattern: /^\s?$/,
|
|
20
|
+
createComboboxInput: () => ({
|
|
21
|
+
children: [{ text: "" }],
|
|
22
|
+
type: KEYS.slashInput
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
plugins: [BaseSlashInputPlugin]
|
|
26
|
+
}).overrideEditor(withTriggerCombobox);
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { BaseSlashPlugin as n, BaseSlashInputPlugin as t };
|
|
30
|
+
//# sourceMappingURL=BaseSlashPlugin-CelcWowr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSlashPlugin-CelcWowr.js","names":["TriggerComboboxPluginOptions","withTriggerCombobox","PluginConfig","createSlatePlugin","createTSlatePlugin","KEYS","SlashConfig","BaseSlashInputPlugin","key","slashInput","editOnly","node","isElement","isInline","isVoid","BaseSlashPlugin","slashCommand","options","trigger","triggerPreviousCharPattern","createComboboxInput","children","text","type","plugins","overrideEditor"],"sources":["../src/lib/BaseSlashPlugin.ts"],"sourcesContent":["import {\n type TriggerComboboxPluginOptions,\n withTriggerCombobox,\n} from '@platejs/combobox';\nimport {\n type PluginConfig,\n createSlatePlugin,\n createTSlatePlugin,\n KEYS,\n} from 'platejs';\n\nexport type SlashConfig = PluginConfig<\n 'slash_command',\n TriggerComboboxPluginOptions\n>;\n\nexport const BaseSlashInputPlugin = createSlatePlugin({\n key: KEYS.slashInput,\n editOnly: true,\n node: { isElement: true, isInline: true, isVoid: true },\n});\n\nexport const BaseSlashPlugin = createTSlatePlugin<SlashConfig>({\n key: KEYS.slashCommand,\n editOnly: true,\n options: {\n trigger: '/',\n triggerPreviousCharPattern: /^\\s?$/,\n createComboboxInput: () => ({\n children: [{ text: '' }],\n type: KEYS.slashInput,\n }),\n },\n plugins: [BaseSlashInputPlugin],\n}).overrideEditor(withTriggerCombobox);\n"],"mappings":";;;;AAgBA,MAAaO,uBAAuBJ,kBAAkB;CACpDK,KAAKH,KAAKI;CACVC,UAAU;CACVC,MAAM;EAAEC,WAAW;EAAMC,UAAU;EAAMC,QAAQ;EAAK;CACvD,CAAC;AAEF,MAAaC,kBAAkBX,mBAAgC;CAC7DI,KAAKH,KAAKW;CACVN,UAAU;CACVO,SAAS;EACPC,SAAS;EACTC,4BAA4B;EAC5BC,4BAA4B;GAC1BC,UAAU,CAAC,EAAEC,MAAM,IAAI,CAAC;GACxBC,MAAMlB,KAAKI;GACZ;EACF;CACDe,SAAS,CAACjB,qBAAoB;CAC/B,CAAC,CAACkB,eAAexB,oBAAoB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TriggerComboboxPluginOptions } from "@platejs/combobox";
|
|
2
|
+
import { PluginConfig } from "platejs";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/BaseSlashPlugin.d.ts
|
|
5
|
+
type SlashConfig = PluginConfig<'slash_command', TriggerComboboxPluginOptions>;
|
|
6
|
+
declare const BaseSlashInputPlugin: any;
|
|
7
|
+
declare const BaseSlashPlugin: any;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { BaseSlashInputPlugin, BaseSlashPlugin, SlashConfig };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/lib/BaseSlashPlugin.ts"],"sourcesContent":[],"mappings":";;;;KAWY,WAAA,GAAc,8BAExB;cAGW;AALD,cAWC,eATX,EAAA,GAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/react/SlashPlugin.tsx"],"sourcesContent":[],"mappings":";cAIa;AAAA,cAEA,WAFsD,EAAA,GAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { n as BaseSlashPlugin, t as BaseSlashInputPlugin } from "../BaseSlashPlugin-CelcWowr.js";
|
|
2
|
+
import { toPlatePlugin } from "platejs/react";
|
|
3
|
+
|
|
4
|
+
//#region src/react/SlashPlugin.tsx
|
|
5
|
+
const SlashInputPlugin = toPlatePlugin(BaseSlashInputPlugin);
|
|
6
|
+
const SlashPlugin = toPlatePlugin(BaseSlashPlugin);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SlashInputPlugin, SlashPlugin };
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["toPlatePlugin","BaseSlashInputPlugin","BaseSlashPlugin","SlashInputPlugin","SlashPlugin"],"sources":["../../src/react/SlashPlugin.tsx"],"sourcesContent":["import { toPlatePlugin } from 'platejs/react';\n\nimport { BaseSlashInputPlugin, BaseSlashPlugin } from '../lib';\n\nexport const SlashInputPlugin = toPlatePlugin(BaseSlashInputPlugin);\n\nexport const SlashPlugin = toPlatePlugin(BaseSlashPlugin);\n"],"mappings":";;;;AAIA,MAAaG,mBAAmBH,cAAcC,qBAAqB;AAEnE,MAAaG,cAAcJ,cAAcE,gBAAgB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lofcz/platejs-slash-command",
|
|
3
|
+
"version": "52.0.15",
|
|
4
|
+
"description": "Slash commands plugin for Plate",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"plate",
|
|
7
|
+
"plugin",
|
|
8
|
+
"slate"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://platejs.org",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/udecode/plate/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/lofcz/plate.git",
|
|
17
|
+
"directory": "packages/slash-command"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"exports": {
|
|
22
|
+
".": "./dist/index.js",
|
|
23
|
+
"./react": "./dist/react/index.js",
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/**/*"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"react-compiler-runtime": "^1.0.0",
|
|
33
|
+
"@platejs/combobox": "npm:@lofcz/platejs-combobox@52.0.15"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@plate/scripts": "1.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"platejs": ">=52.0.15",
|
|
40
|
+
"react": ">=18.0.0",
|
|
41
|
+
"react-dom": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"type": "module",
|
|
47
|
+
"module": "./dist/index.js",
|
|
48
|
+
"scripts": {
|
|
49
|
+
"brl": "plate-pkg p:brl",
|
|
50
|
+
"build": "plate-pkg p:build",
|
|
51
|
+
"build:watch": "plate-pkg p:build:watch",
|
|
52
|
+
"clean": "plate-pkg p:clean",
|
|
53
|
+
"lint": "plate-pkg p:lint",
|
|
54
|
+
"lint:fix": "plate-pkg p:lint:fix",
|
|
55
|
+
"test": "plate-pkg p:test",
|
|
56
|
+
"test:watch": "plate-pkg p:test:watch",
|
|
57
|
+
"typecheck": "plate-pkg p:typecheck"
|
|
58
|
+
}
|
|
59
|
+
}
|