dsh-width-tiers 2.0.0 → 2.0.1

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/README.md CHANGED
@@ -35,7 +35,7 @@ Fixed and custom widths are clamped by the app to
35
35
  - Uses the app's native width axis (`--dsh-chat-user-width` and
36
36
  `dsh.conversation.contentWidth`), so the built-in drag handles keep working.
37
37
  - Persists the selected tier and restores it on the next visit.
38
- - Follows **Settings → Language** (中文 / English).
38
+ - Follows **Settings → Language** (中文 / English / 日本語 / Español / Français / Deutsch / Русский / Português).
39
39
  - Menu supports ArrowUp/Down, Home/End, Escape and Tab, with focus restoration.
40
40
  - Tier changes sync across tabs.
41
41
  - Respects `prefers-reduced-motion`.
package/README.zh.md CHANGED
@@ -33,7 +33,7 @@
33
33
  - 走应用原生宽度通道(`--dsh-chat-user-width` 与
34
34
  `dsh.conversation.contentWidth`),自带拖拽手柄始终可用。
35
35
  - 记住当前档位,下次打开自动恢复。
36
- - 跟随 **设置 → 语言**(中文 / English)。
36
+ - 跟随 **设置 → 语言**(中文 / English / 日本語 / Español / Français / Deutsch / Русский / Português)。
37
37
  - 菜单支持方向键、Home/End、Esc、Tab,并恢复焦点。
38
38
  - 档位选择跨标签页同步。
39
39
  - 支持 `prefers-reduced-motion`。
package/lib/client.js CHANGED
@@ -880,33 +880,116 @@ window.__ModuleLoader__.load({
880
880
  // src/client/locales.ts
881
881
  /** Dictionary namespace owned by this plugin. */
882
882
  const NS = "width-tiers";
883
- /** Simplified Chinese dictionary (the key-set source of truth). */
884
- const zh = {
885
- "tier.standard": "标准",
886
- "tier.medium": "中等",
887
- "tier.wide": "宽",
888
- "tier.ultra": "超宽",
889
- "tier.full": "全宽",
890
- "tier.custom": "自定义",
891
- "value.custom.unset": "未设置",
892
- "guide.hint": "拖拽右侧边缘调整对话宽度",
893
- "button.aria": "对话区宽度档位:{label}({value}),点击选择档位",
894
- "button.title.summary": "对话区宽度档位:{label}({value})",
895
- "button.title.hint": "点击选择:{list}"
896
- };
897
- /** English dictionary, checked complete against the zh key set. */
898
- const en = {
899
- "tier.standard": "Standard",
900
- "tier.medium": "Medium",
901
- "tier.wide": "Wide",
902
- "tier.ultra": "Ultra",
903
- "tier.full": "Full",
904
- "tier.custom": "Custom",
905
- "value.custom.unset": "Not set",
906
- "guide.hint": "Drag the right edge to resize",
907
- "button.aria": "Chat width tier: {label} ({value}). Click to choose a tier.",
908
- "button.title.summary": "Chat width tier: {label} ({value})",
909
- "button.title.hint": "Click to choose: {list}"
883
+ /**
884
+ * Every shipped dictionary, keyed by the locale id the DSH locale service
885
+ * accepts. The set matches the languages DSH 0.2.2 ships (zh, en, ja, es,
886
+ * fr, de, ru, pt); other languages fall back through English.
887
+ */
888
+ const dictionaries = {
889
+ zh: {
890
+ "tier.standard": "标准",
891
+ "tier.medium": "中等",
892
+ "tier.wide": "宽",
893
+ "tier.ultra": "超宽",
894
+ "tier.full": "全宽",
895
+ "tier.custom": "自定义",
896
+ "value.custom.unset": "未设置",
897
+ "guide.hint": "拖拽右侧边缘调整对话宽度",
898
+ "button.aria": "对话区宽度档位:{label}({value}),点击选择档位",
899
+ "button.title.summary": "对话区宽度档位:{label}({value})",
900
+ "button.title.hint": "点击选择:{list}"
901
+ },
902
+ en: {
903
+ "tier.standard": "Standard",
904
+ "tier.medium": "Medium",
905
+ "tier.wide": "Wide",
906
+ "tier.ultra": "Ultra",
907
+ "tier.full": "Full",
908
+ "tier.custom": "Custom",
909
+ "value.custom.unset": "Not set",
910
+ "guide.hint": "Drag the right edge to resize",
911
+ "button.aria": "Chat width tier: {label} ({value}). Click to choose a tier.",
912
+ "button.title.summary": "Chat width tier: {label} ({value})",
913
+ "button.title.hint": "Click to choose: {list}"
914
+ },
915
+ ja: {
916
+ "tier.standard": "標準",
917
+ "tier.medium": "中",
918
+ "tier.wide": "ワイド",
919
+ "tier.ultra": "ウルトラワイド",
920
+ "tier.full": "全幅",
921
+ "tier.custom": "カスタム",
922
+ "value.custom.unset": "未設定",
923
+ "guide.hint": "右端をドラッグして会話幅を調整",
924
+ "button.aria": "会話エリアの幅設定:{label}({value})。クリックして選択",
925
+ "button.title.summary": "会話エリアの幅設定:{label}({value})",
926
+ "button.title.hint": "クリックして選択:{list}"
927
+ },
928
+ es: {
929
+ "tier.standard": "Estándar",
930
+ "tier.medium": "Medio",
931
+ "tier.wide": "Ancho",
932
+ "tier.ultra": "Muy ancho",
933
+ "tier.full": "Completo",
934
+ "tier.custom": "Personalizado",
935
+ "value.custom.unset": "Sin definir",
936
+ "guide.hint": "Arrastra el borde derecho para ajustar el ancho",
937
+ "button.aria": "Ancho del área de chat: {label} ({value}). Haz clic para elegir un nivel.",
938
+ "button.title.summary": "Ancho del área de chat: {label} ({value})",
939
+ "button.title.hint": "Haz clic para elegir: {list}"
940
+ },
941
+ fr: {
942
+ "tier.standard": "Standard",
943
+ "tier.medium": "Moyen",
944
+ "tier.wide": "Large",
945
+ "tier.ultra": "Très large",
946
+ "tier.full": "Pleine largeur",
947
+ "tier.custom": "Personnalisé",
948
+ "value.custom.unset": "Non défini",
949
+ "guide.hint": "Faites glisser le bord droit pour ajuster la largeur",
950
+ "button.aria": "Largeur de la zone de chat : {label} ({value}). Cliquez pour choisir un palier.",
951
+ "button.title.summary": "Largeur de la zone de chat : {label} ({value})",
952
+ "button.title.hint": "Cliquez pour choisir : {list}"
953
+ },
954
+ de: {
955
+ "tier.standard": "Standard",
956
+ "tier.medium": "Mittel",
957
+ "tier.wide": "Breit",
958
+ "tier.ultra": "Sehr breit",
959
+ "tier.full": "Volle Breite",
960
+ "tier.custom": "Benutzerdefiniert",
961
+ "value.custom.unset": "Nicht festgelegt",
962
+ "guide.hint": "Rechten Rand ziehen, um die Breite anzupassen",
963
+ "button.aria": "Chatbreite: {label} ({value}). Klicken, um eine Stufe zu wählen.",
964
+ "button.title.summary": "Chatbreite: {label} ({value})",
965
+ "button.title.hint": "Klicken zum Auswählen: {list}"
966
+ },
967
+ ru: {
968
+ "tier.standard": "Стандартная",
969
+ "tier.medium": "Средняя",
970
+ "tier.wide": "Широкая",
971
+ "tier.ultra": "Очень широкая",
972
+ "tier.full": "На всю ширину",
973
+ "tier.custom": "Своя",
974
+ "value.custom.unset": "Не задано",
975
+ "guide.hint": "Перетащите правый край, чтобы изменить ширину",
976
+ "button.aria": "Ширина области чата: {label} ({value}). Нажмите, чтобы выбрать уровень.",
977
+ "button.title.summary": "Ширина области чата: {label} ({value})",
978
+ "button.title.hint": "Нажмите, чтобы выбрать: {list}"
979
+ },
980
+ pt: {
981
+ "tier.standard": "Padrão",
982
+ "tier.medium": "Médio",
983
+ "tier.wide": "Largo",
984
+ "tier.ultra": "Muito largo",
985
+ "tier.full": "Largura total",
986
+ "tier.custom": "Personalizado",
987
+ "value.custom.unset": "Não definido",
988
+ "guide.hint": "Arraste a borda direita para ajustar a largura",
989
+ "button.aria": "Largura da área de chat: {label} ({value}). Clique para escolher um nível.",
990
+ "button.title.summary": "Largura da área de chat: {label} ({value})",
991
+ "button.title.hint": "Clique para escolher: {list}"
992
+ }
910
993
  };
911
994
  // src/client/WidthTierPicker.tsx
912
995
  /** How long the selection ring stays on the button. */
@@ -1114,10 +1197,12 @@ window.__ModuleLoader__.load({
1114
1197
  * @param ctx - client root context (slots + layout + locale injected).
1115
1198
  */
1116
1199
  function apply(ctx) {
1117
- ctx.effect(() => ctx.locale.register(NS, {
1118
- zh,
1119
- en
1120
- }), "dsh-width-tiers: dictionaries");
1200
+ ctx.effect(() => {
1201
+ const disposers = Object.entries(dictionaries).map(([locale, dictionary]) => ctx.locale.register(NS, locale, dictionary));
1202
+ return () => {
1203
+ for (const dispose of disposers) dispose();
1204
+ };
1205
+ }, "dsh-width-tiers: dictionaries");
1121
1206
  const t = ctx.locale.bind(NS);
1122
1207
  const controller = createWidthTiers({
1123
1208
  layout: ctx.layout,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-width-tiers",
3
- "version": "2.0.0",
4
- "description": "DSH Web client plugin: chat content width tiers (standard / medium / wide / ultra / full / custom) with a floating picker button. Mounts into the app's shell.overlay slot on DSH 0.2.x and drives the native width axis, so the built-in drag handles keep working. UI copy follows the app language (zh / en).",
3
+ "version": "2.0.1",
4
+ "description": "DSH Web client plugin: chat content width tiers (standard / medium / wide / ultra / full / custom) with a floating picker button. Mounts into the app's shell.overlay slot on DSH 0.2.x and drives the native width axis, so the built-in drag handles keep working. UI copy follows the app language (zh / en / ja / es / fr / de / ru / pt).",
5
5
  "license": "MIT",
6
6
  "author": "aaronlei",
7
7
  "publishConfig": {