First implementation of Plimi
This commit is contained in:
46
src/tools/text-case/index.ts
Normal file
46
src/tools/text-case/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PlimiPlugin } from "../../core/plugins/plugin-types";
|
||||
import { runTextCase } from "./run";
|
||||
|
||||
export interface TextCaseOptions {
|
||||
to: "UPPERCASE" | "lowercase" | "camelCase" | "snake_case" | "kebab-case";
|
||||
}
|
||||
|
||||
export const textCasePlugin: PlimiPlugin<TextCaseOptions> = {
|
||||
manifest: {
|
||||
id: "txt-case",
|
||||
name: "Case Converter",
|
||||
description: "Convert text between camelCase, snake_case, etc.",
|
||||
category: "text",
|
||||
version: "1.0.0",
|
||||
tags: ["case", "text", "camel", "snake"],
|
||||
input: { type: "text" },
|
||||
output: { type: "text" },
|
||||
example: "hello world example text",
|
||||
offlineReady: true,
|
||||
},
|
||||
|
||||
optionsSchema: {
|
||||
fields: [
|
||||
{
|
||||
type: "select",
|
||||
key: "to",
|
||||
label: "Convert to",
|
||||
defaultValue: "snake_case",
|
||||
options: [
|
||||
{ label: "UPPERCASE", value: "UPPERCASE" },
|
||||
{ label: "lowercase", value: "lowercase" },
|
||||
{ label: "camelCase", value: "camelCase" },
|
||||
{ label: "snake_case", value: "snake_case" },
|
||||
{ label: "kebab-case", value: "kebab-case" },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
capabilities: {
|
||||
cancelable: false,
|
||||
worker: false,
|
||||
},
|
||||
|
||||
run: runTextCase,
|
||||
};
|
||||
Reference in New Issue
Block a user