feat: add TypeScript support

This commit is contained in:
Juanfran
2025-11-05 17:09:45 +01:00
parent dde0fddd6f
commit a08c2ca46e
17 changed files with 1031 additions and 18 deletions

8
frontend/ts/package.json Normal file
View File

@@ -0,0 +1,8 @@
{
"name": "@penpot/ts",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"type": "module",
"packageManager": "yarn@4.3.1"
}

View File

@@ -0,0 +1,3 @@
.title {
color: green;
}

View File

@@ -0,0 +1,16 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC
import {TestTsxComponent } from "./test-tsx";
export default {
title: "TestTSX",
component: TestTsxComponent,
argTypes: {},
parameters: {},
};
export const Default = {};

View File

@@ -0,0 +1,11 @@
import styles from './test-tsx.module.css';
import { translate } from '../penpot-bridge';
export const TestTsxComponent = () => {
return (
<div>
<h2 className={styles.title}>{translate("labels.delete")} xx</h2>
</div>
);
};

View File

@@ -0,0 +1,4 @@
/* eslint-disable */
export { TestTsxComponent } from "./components/test-tsx";
export { setTranslation } from "./penpot-bridge";

View File

@@ -0,0 +1,7 @@
export let translate = (key: string) => {
return key;
};
export function setTranslation(translations: (key: string) => string) {
translate = translations;
}