@mulmoclaude/mulmoscript-plugin 0.2.2 → 1.0.0

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.
@@ -1,9 +1,8 @@
1
- import { type ComputedRef } from "vue";
2
1
  import type { Messages } from "./messages";
3
2
  /** Reactive message bundle for the active host locale. The plugin carries its
4
3
  * own translations (no host i18n dependency); it reads the locale off the
5
4
  * injected `BrowserPluginRuntime.locale` ref and falls back to English.
6
5
  * Same pattern as @mulmoclaude/html-plugin. */
7
- export declare function useT(): ComputedRef<Messages>;
6
+ export declare const useT: () => import("vue").ComputedRef<Messages>;
8
7
  export type { Messages };
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lang/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,EAAY,MAAM,KAAK,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAoB3C;;;gDAGgD;AAChD,wBAAgB,IAAI,IAAI,WAAW,CAAC,QAAQ,CAAC,CAI5C;AAED,YAAY,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lang/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAY3C;;;gDAGgD;AAChD,eAAO,MAAM,IAAI,2CAAuB,CAAC;AAEzC,YAAY,EAAE,QAAQ,EAAE,CAAC"}
@@ -12,7 +12,7 @@ export { MULMOSCRIPT_HOST_ADAPTER_KEY, useHostAdapter, type MulmoScriptHostAdapt
12
12
  export { useMulmoScriptTransport, type MulmoScriptTransport, type TransportResult } from "./transport";
13
13
  export { View, Preview };
14
14
  declare const _default: {
15
- plugin: ToolPlugin<MulmoScriptData, MulmoScriptData, SaveMulmoScriptArgs, import("gui-chat-protocol/vue").InputHandler, Record<string, unknown>>;
15
+ plugin: ToolPlugin<MulmoScriptData, MulmoScriptData, SaveMulmoScriptArgs, import("gui-chat-protocol").InputHandler, Record<string, unknown>>;
16
16
  };
17
17
  export default _default;
18
18
  //# sourceMappingURL=index.d.ts.map
package/dist/vue.cjs CHANGED
@@ -188,9 +188,11 @@ var EMPTY_ADAPTER = {};
188
188
  function useHostAdapter() {
189
189
  return (0, vue.inject)(MULMOSCRIPT_HOST_ADAPTER_KEY, EMPTY_ADAPTER);
190
190
  }
191
- //#endregion
192
- //#region src/lang/index.ts
193
- var MESSAGES = {
191
+ /** Reactive message bundle for the active host locale. The plugin carries its
192
+ * own translations (no host i18n dependency); it reads the locale off the
193
+ * injected `BrowserPluginRuntime.locale` ref and falls back to English.
194
+ * Same pattern as @mulmoclaude/html-plugin. */
195
+ var useT = (0, gui_chat_protocol_vue.createUseT)({
194
196
  de: {
195
197
  beatCount: (count) => count === 1 ? `${count} Beat` : `${count} Beats`,
196
198
  movie: "Video",
@@ -447,18 +449,7 @@ var MESSAGES = {
447
449
  close: "关闭",
448
450
  cancel: "取消"
449
451
  }
450
- };
451
- function isSupportedLocale(value) {
452
- return Object.hasOwn(MESSAGES, value);
453
- }
454
- /** Reactive message bundle for the active host locale. The plugin carries its
455
- * own translations (no host i18n dependency); it reads the locale off the
456
- * injected `BrowserPluginRuntime.locale` ref and falls back to English.
457
- * Same pattern as @mulmoclaude/html-plugin. */
458
- function useT() {
459
- const locale = (0, vue.inject)(gui_chat_protocol_vue.PLUGIN_RUNTIME_KEY, void 0)?.locale ?? (0, vue.ref)("en");
460
- return (0, vue.computed)(() => isSupportedLocale(locale.value) ? MESSAGES[locale.value] : MESSAGES.en);
461
- }
452
+ });
462
453
  //#endregion
463
454
  //#region src/vue/View.vue?vue&type=script&setup=true&lang.ts
464
455
  var _hoisted_1$1 = { class: "h-full bg-white flex flex-col overflow-hidden" };