diff --git a/inlang/source-code/doc-layout-component/package.json b/inlang/source-code/doc-layout-component/package.json index 3bd3675e86..9cb11df2ac 100644 --- a/inlang/source-code/doc-layout-component/package.json +++ b/inlang/source-code/doc-layout-component/package.json @@ -23,6 +23,7 @@ "license": "ISC", "devDependencies": { "@inlang/marketplace-registry": "workspace:^", + "@inlang/marketplace-manifest": "workspace:^", "@nx/storybook": "^18.0.4", "@storybook/addon-essentials": "^7.6.16", "@storybook/addon-links": "^7.6.16", diff --git a/inlang/source-code/doc-layout-component/src/mock/manifest.ts b/inlang/source-code/doc-layout-component/src/mock/manifest.ts new file mode 100644 index 0000000000..7c383a97fa --- /dev/null +++ b/inlang/source-code/doc-layout-component/src/mock/manifest.ts @@ -0,0 +1,51 @@ +import type { MarketplaceManifest } from "@inlang/marketplace-manifest" + +export const manifest: MarketplaceManifest = { + $schema: "https://inlang.com/schema/marketplace-manifest", + id: "library.inlang.paraglideJs", + icon: "https://cdn.jsdelivr.net/gh/opral/monorepo@latest/inlang/source-code/paraglide/paraglide-js/assets/paraglideNoBg.png", + gallery: [ + "https://cdn.jsdelivr.net/gh/opral/monorepo@latest/inlang/source-code/paraglide/paraglide-js/assets/og.png", + "https://cdn.jsdelivr.net/gh/opral/monorepo@latest/inlang/assets/marketplace/paraglide-gallery/paraglide-gallery-image-1.jpg", + "https://cdn.jsdelivr.net/gh/opral/monorepo@latest/inlang/assets/marketplace/paraglide-gallery/paraglide-gallery-image-2.jpg", + "https://cdn.jsdelivr.net/gh/opral/monorepo@latest/inlang/assets/marketplace/paraglide-gallery/paraglide-gallery-image-3.jpg", + "https://cdn.jsdelivr.net/gh/opral/monorepo@latest/inlang/assets/marketplace/paraglide-gallery/paraglide-gallery-image-4.jpg", + ], + displayName: { + en: "Paraglide JS", + }, + description: { + en: "Simple, adaptable and tiny i18n library that integrates with any framework", + }, + pages: { + "/": "./inlang/source-code/paraglide/paraglide-js/README.md", + "/changelog": "./inlang/source-code/paraglide/paraglide-js/CHANGELOG.md", + }, + keywords: [ + "paraglide js", + "libraries", + "apps", + "website", + "developer", + "paraglide", + "i18n", + "library", + "localization", + "sdk", + "sdk-js", + "svelte", + "react", + "nextjs", + "remix", + "vue", + "astro", + "javascript", + "solid", + "typescript", + ], + recommends: ["m/reootnfj", "m/632iow21", "m/r7kp499g", "m/teldgniy"], + pricing: "free", + publisherName: "inlang", + publisherIcon: "https://inlang.com/favicon/safari-pinned-tab.svg", + license: "Apache-2.0", +} diff --git a/inlang/source-code/doc-layout-component/src/mock/project.ts b/inlang/source-code/doc-layout-component/src/mock/project.ts deleted file mode 100644 index a9f82ee3ca..0000000000 --- a/inlang/source-code/doc-layout-component/src/mock/project.ts +++ /dev/null @@ -1,359 +0,0 @@ -import type { InlangProject } from "@inlang/sdk" - -export const mockSettings: ReturnType = { - $schema: "https://inlang.com/schema/project-settings", - sourceLanguageTag: "en", - languageTags: ["en", "es", "fr", "pt-br", "ru", "zh-cn"], - messageLintRuleLevels: { - "messageLintRule.inlang.identicalPattern": "error", - }, - modules: [ - "https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@4/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js", - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js", - ], - "plugin.inlang.i18next": { - pathPattern: { - brain: "./frontend/public/locales/{languageTag}/brain.json", - chat: "./frontend/public/locales/{languageTag}/chat.json", - config: "./frontend/public/locales/{languageTag}/config.json", - contact: "./frontend/public/locales/{languageTag}/contact.json", - deleteOrUnsubscribeFormBrain: - "./frontend/public/locales/{languageTag}/deleteOrUnsubscribeFormBrain.json", - explore: "./frontend/public/locales/{languageTag}/explore.json", - external_api_definition: - "./frontend/public/locales/{languageTag}/external_api_definition.json", - home: "./frontend/public/locales/{languageTag}/home.json", - invitation: "./frontend/public/locales/{languageTag}/invitation.json", - knowledge: "./frontend/public/locales/{languageTag}/knowledge.json", - login: "./frontend/public/locales/{languageTag}/login.json", - logout: "./frontend/public/locales/{languageTag}/logout.json", - monetization: "./frontend/public/locales/{languageTag}/monetization.json", - translation: "./frontend/public/locales/{languageTag}/translation.json", - upload: "./frontend/public/locales/{languageTag}/upload.json", - user: "./frontend/public/locales/{languageTag}/user.json", - }, - }, -} - -export const mockInstalledPlugins = [ - { - id: "plugin.inlang.i18next", - displayName: { - en: "i18next", - }, - description: { - en: "i18next", - }, - module: "https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@4/dist/index.js", - settingsSchema: { - type: "object", - properties: { - pathPattern: { - title: "Path to language files", - anyOf: [ - { - pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", - description: - "Specify the pathPattern to locate language files in your repository. It must include `{languageTag}` and end with `.json`.", - examples: [ - "./{languageTag}/file.json", - "../folder/{languageTag}/file.json", - "./{languageTag}.json", - ], - type: "string", - }, - { - type: "object", - patternProperties: { - "^[^.]+$": { - pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", - description: "It must include `{languageTag}` and end with `.json`.", - examples: [ - "./{languageTag}/file.json", - "../folder/{languageTag}/file.json", - "./{languageTag}.json", - ], - type: "string", - }, - }, - }, - ], - }, - variableReferencePattern: { - type: "array", - title: "Variable reference pattern", - description: - "The pattern to match content in the messages. You can define an opening and closing pattern. The closing pattern is not required. The default is '{{' and '}}'.", - examples: ["{ and }", "{{ and }}", "< and >", "@:"], - items: { - type: "string", - }, - }, - sourceLanguageFilePath: { - title: "Source language file path", - description: - "Sometimes it is necessary to specify the location of the source language file(s) when they do not follow the standard naming or file structure convention.", - anyOf: [ - { - pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", - description: "The pathPattern must contain `{languageTag}` and end with `.json`.", - examples: [ - "./{languageTag}/file.json", - "../folder/{languageTag}/file.json", - "./{languageTag}.json", - ], - type: "string", - }, - { - type: "object", - patternProperties: { - "^[^.]+$": { - pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", - description: "The pathPattern must contain `{languageTag}` and end with `.json`.", - examples: [ - "./{languageTag}/file.json", - "../folder/{languageTag}/file.json", - "./{languageTag}.json", - ], - type: "string", - }, - }, - }, - ], - }, - ignore: { - type: "array", - title: "Ignore paths", - description: "Set a path that should be ignored.", - items: { - type: "string", - }, - }, - }, - required: ["pathPattern"], - }, - }, -] - -export const mockInstalledMessageLintRules = [ - { - id: "messageLintRule.inlang.emptyPattern", - displayName: { - en: "Empty Pattern", - }, - description: { - en: "Empty Pattern", - }, - module: - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js", - }, - { - id: "messageLintRule.inlang.identicalPattern", - displayName: { - en: "Identical Pattern", - }, - description: { - en: "Identical Pattern", - }, - module: - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js", - settingsSchema: { - type: "object", - properties: { - ignore: { - type: "array", - items: { - pattern: "[^*]", - description: "All items in the array need quotaion marks at the end and beginning", - type: "string", - }, - title: "DEPRECATED. Ignore paths", - description: "Set a path that should be ignored.", - }, - }, - }, - }, - { - id: "messageLintRule.inlang.missingTranslation", - displayName: { - en: "Missing Translation", - }, - description: { - en: "Missing Translation", - }, - module: - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js", - }, - { - id: "messageLintRule.inlang.messageWithoutSource", - displayName: { - en: "Message Without Source", - }, - description: { - en: "Message Without Source", - }, - module: - "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js", - }, -] - -// export const mockProject = { -// id: "mock-project", -// installed: { -// plugins: () => [ -// { -// id: "plugin.inlang.i18next", -// displayName: { -// en: "i18next", -// }, -// description: { -// en: "i18next", -// }, -// module: "https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@4/dist/index.js", -// settingsSchema: { -// type: "object", -// properties: { -// pathPattern: { -// anyOf: [ -// { -// pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", -// description: "The pathPattern must contain `{languageTag}` and end with `.json`.", -// examples: [ -// "./{languageTag}/file.json", -// "../folder/{languageTag}/file.json", -// "./{languageTag}.json", -// ], -// type: "string", -// }, -// { -// type: "object", -// patternProperties: { -// "^[^.]+$": { -// pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", -// description: -// "The pathPattern must contain `{languageTag}` and end with `.json`.", -// examples: [ -// "./{languageTag}/file.json", -// "../folder/{languageTag}/file.json", -// "./{languageTag}.json", -// ], -// type: "string", -// }, -// }, -// }, -// ], -// }, -// variableReferencePattern: { -// type: "array", -// items: { -// type: "string", -// }, -// }, -// sourceLanguageFilePath: { -// anyOf: [ -// { -// pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", -// description: "The pathPattern must contain `{languageTag}` and end with `.json`.", -// examples: [ -// "./{languageTag}/file.json", -// "../folder/{languageTag}/file.json", -// "./{languageTag}.json", -// ], -// type: "string", -// }, -// { -// type: "object", -// patternProperties: { -// "^[^.]+$": { -// pattern: "^(\\./|\\../|/)[^*]*\\{languageTag\\}[^*]*\\.json", -// description: -// "The pathPattern must contain `{languageTag}` and end with `.json`.", -// examples: [ -// "./{languageTag}/file.json", -// "../folder/{languageTag}/file.json", -// "./{languageTag}.json", -// ], -// type: "string", -// }, -// }, -// }, -// ], -// }, -// ignore: { -// type: "array", -// items: { -// type: "string", -// }, -// }, -// }, -// required: ["pathPattern"], -// }, -// }, -// ], -// messageLintRules: () => [ -// { -// id: "messageLintRule.inlang.emptyPattern", -// displayName: { -// en: "Empty Pattern", -// }, -// description: { -// en: "Empty Pattern", -// }, -// module: -// "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js", -// }, -// { -// id: "messageLintRule.inlang.identicalPattern", -// displayName: { -// en: "Identical Pattern", -// }, -// description: { -// en: "Identical Pattern", -// }, -// module: -// "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-identical-pattern@latest/dist/index.js", -// settingsSchema: { -// type: "object", -// properties: { -// ignore: { -// type: "array", -// items: { -// pattern: "[^*]", -// description: "All items in the array need quotaion marks at the end and beginning", -// type: "string", -// }, -// }, -// }, -// }, -// }, -// { -// id: "messageLintRule.inlang.missingTranslation", -// displayName: { -// en: "Missing Translation", -// }, -// description: { -// en: "Missing Translation", -// }, -// module: -// "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js", -// }, -// { -// id: "messageLintRule.inlang.messageWithoutSource", -// displayName: { -// en: "Message Without Source", -// }, -// description: { -// en: "Message Without Source", -// }, -// module: -// "https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js", -// }, -// ], -// }, -// errors: () => [], -// settings: () => mockSettings, -// setSettings: (settings: any) => (mockSettings = settings), -// } diff --git a/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.stories.ts b/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.stories.ts index 9b96f48d6f..bba7a1c321 100644 --- a/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.stories.ts +++ b/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.stories.ts @@ -1,6 +1,7 @@ import "./inlang-doc-layout.ts" import type { Meta, StoryObj } from "@storybook/web-components" import { html } from "lit" +import { manifest } from "./../mock/manifest.ts" const meta: Meta = { component: "inlang-doc-layout", @@ -10,9 +11,10 @@ const meta: Meta = { export default meta export const Props: StoryObj = { - render: () => html` `, + render: () => html`doc-layout `, } export const Attributes: StoryObj = { - render: () => html` `, + render: () => + html` doc-layout `, } diff --git a/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.ts b/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.ts index cc463065b2..f4dd351b81 100644 --- a/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.ts +++ b/inlang/source-code/doc-layout-component/src/stories/inlang-doc-layout.ts @@ -1,12 +1,16 @@ import { html, LitElement, css } from "lit" -import { customElement } from "lit/decorators.js" +import { customElement, property } from "lit/decorators.js" import { baseStyling } from "../styling/base.js" +import type { MarketplaceManifest } from "@inlang/marketplace-manifest" import overridePrimitiveColors from "./../helper/overridePrimitiveColors.js" @customElement("inlang-doc-layout") export default class InlangDocLayout extends LitElement { static override styles = [baseStyling, css``] + @property({ type: Object }) + manifest: MarketplaceManifest = {} as MarketplaceManifest + override async firstUpdated() { await this.updateComplete @@ -15,7 +19,10 @@ export default class InlangDocLayout extends LitElement { } override render() { - return html`
doc-layout-component
` + return html`
+

${this.manifest.id}

+ +
` } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60b53f0a61..ccf81c673f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -409,6 +409,9 @@ importers: specifier: ^2.4.2 version: 2.4.2 devDependencies: + '@inlang/marketplace-manifest': + specifier: workspace:^ + version: link:../versioned-interfaces/marketplace-manifest '@inlang/marketplace-registry': specifier: workspace:^ version: link:../marketplace-registry