feat: localize IM settings

This commit is contained in:
xmanrui 2026-08-17 15:36:00 +08:00
parent 9d50ee7d03
commit acd38ec3ee
16 changed files with 2161 additions and 1060 deletions

View file

@ -1,6 +1,7 @@
import * as React from 'react';
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from '../../credential-binding.js';
import { h } from '../../i18n.js';
import {
DINGTALK_ENDPOINTS,
DINGTALK_RPC_CHANNEL,
@ -13,7 +14,6 @@ import {
} from './api.js';
import { installDingtalkStyles } from './styles.js';
const h = React.createElement;
const ACTIVE_PROVISION_STATES = new Set(['pending', 'scanned', 'authorizing', 'creating', 'connecting']);
export const name = 'dingtalk-settings';

View file

@ -2,6 +2,7 @@ import * as React from "react";
import { FeishuLogoGlyph } from "../../channel-logos.js";
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from "../../credential-binding.js";
import { h } from "../../i18n.js";
import {
FEISHU_ENDPOINTS,
FEISHU_RPC_CHANNEL,
@ -15,8 +16,6 @@ import {
import { useAnimationFrameScheduler } from "../../lifecycle.js";
import { installFeishuStyles } from "./styles.js";
const h = React.createElement;
export const name = "feishu-settings";
export const inject = ["slots", "connection"];

View file

@ -2,6 +2,7 @@ import * as React from 'react';
import { QqLogoGlyph } from '../../channel-logos.js';
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from '../../credential-binding.js';
import { h } from '../../i18n.js';
import { installDingtalkStyles } from '../dingtalk/styles.js';
import {
QQ_ENDPOINTS,
@ -15,7 +16,6 @@ import {
} from './api.js';
import { installQqStyles } from './styles.js';
const h = React.createElement;
const ACTIVE_STATES = new Set(['pending', 'refreshing', 'connecting']);
const Button = React.forwardRef(function Button({ children, kind = 'secondary', className = '', ...props }, ref) {

View file

@ -1,10 +1,9 @@
import * as React from 'react';
import { CredentialActionIcon, CredentialBindingPanel } from '../../credential-binding.js';
import { h } from '../../i18n.js';
import { installDingtalkStyles } from '../dingtalk/styles.js';
const h = React.createElement;
const Button = React.forwardRef(function Button(
{ children, kind = 'secondary', className = '', ...props },
ref,

View file

@ -1,6 +1,7 @@
import * as React from 'react';
import { SlackLogoGlyph } from '../../channel-logos.js';
import { h } from '../../i18n.js';
import { createTokenChannelSettings } from '../shared/token-channel.js';
import {
SLACK_CREATE_APP_URL,
@ -9,8 +10,6 @@ import {
import { SLACK_ENDPOINTS, slackClientApi } from './api.js';
import { installSlackStyles } from './styles.js';
const h = React.createElement;
export function SlackCredentialPanel({ busy, error, onSubmit, onCancel }) {
const [botToken, setBotToken] = React.useState('');
const [appToken, setAppToken] = React.useState('');

View file

@ -2,6 +2,7 @@ import * as React from 'react';
import { WecomLogoGlyph } from '../../channel-logos.js';
import { CredentialActionIcon, CredentialBindingPanel, QrActionIcon } from '../../credential-binding.js';
import { h } from '../../i18n.js';
import { installDingtalkStyles } from '../dingtalk/styles.js';
import {
WECOM_ENDPOINTS,
@ -15,7 +16,6 @@ import {
} from './api.js';
import { installWecomStyles } from './styles.js';
const h = React.createElement;
const ACTIVE_STATES = new Set(['pending', 'refreshing', 'connecting']);
const Button = React.forwardRef(function Button({ children, kind = 'secondary', className = '', ...props }, ref) {

View file

@ -2,6 +2,7 @@ import * as React from 'react';
import { WeixinLogoGlyph } from '../../channel-logos.js';
import { QrActionIcon } from '../../credential-binding.js';
import { h } from '../../i18n.js';
import {
WEIXIN_ENDPOINTS,
WEIXIN_RPC_CHANNEL,
@ -16,8 +17,6 @@ import {
import { createPollScheduler, useAnimationFrameScheduler } from '../../lifecycle.js';
import { installWeixinStyles } from './styles.js';
const h = React.createElement;
export const name = 'weixin-settings';
export const inject = ['slots', 'connection'];

View file

@ -2,6 +2,7 @@ import * as React from 'react';
import { WhatsappLogoGlyph } from '../../channel-logos.js';
import { QrActionIcon } from '../../credential-binding.js';
import { h } from '../../i18n.js';
import { installDingtalkStyles } from '../dingtalk/styles.js';
import {
WHATSAPP_ENDPOINTS,
@ -14,7 +15,6 @@ import {
} from './api.js';
import { installWhatsappStyles } from './styles.js';
const h = React.createElement;
const ACTIVE_STATES = new Set(['pending', 'connecting']);
const Button = React.forwardRef(function Button(