@loafacto/ui 0.8.6 → 0.8.7

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/dist/index.d.ts CHANGED
@@ -54,4 +54,5 @@ export { useConfirm } from './composables/useConfirm';
54
54
  export { applyTheme, DARK_THEME, LIGHT_THEME, DEFAULT_THEME, type ThemeConfig, } from './theme/applyTheme';
55
55
  export { initTheme, useTheme, type ThemeMode } from './theme/useTheme';
56
56
  export { deriveSemanticPalette, applySemanticPalette, isLightBackground, colorToRgb, hexToRgb, luminance, contrastRatio, type SemanticPalette, } from './theme/themeColors';
57
+ export { LOAFACTO_SERVICES, serviceIdForPath, isServicePath, } from './services';
57
58
  export type { ServiceDescriptor, ShellUser, ShortcutLink, LfOption, LfTableColumn, LfTableSort, } from './types';
package/dist/index.js CHANGED
@@ -2,6 +2,53 @@ import { readonly, ref, openBlock, createElementBlock, createStaticVNode, create
2
2
  import { a as applyTheme, D as DARK_THEME, L as LIGHT_THEME } from "./applyTheme-EBr0eOKY.js";
3
3
  import { b, c, d, e, f, h, i, l } from "./applyTheme-EBr0eOKY.js";
4
4
  import { defineStore } from "pinia";
5
+ const LOAFACTO_SERVICES = [
6
+ {
7
+ /**
8
+ * 매크로 — **여기 한 줄이 이 서비스의 첫인상 전부다.**
9
+ *
10
+ * 「반복 작업 자동화 매크로 편집·실행」이었던 때가 있다. 만드는 사람의 말이라 무엇이
11
+ * 좋아지는지는 안 나오고, 「편집·실행」은 어느 도구에나 붙는 말이다.
12
+ *
13
+ * 그리고 이 서비스에는 다른 서비스에 없는 전제가 있다 — **윈도우 PC 한 대가 켜져
14
+ * 있어야 한다.** 내 PC 에 러너를 깔아야 돌아가기 때문이다. 그걸 모르고 들어가면
15
+ * 로그인까지 마친 뒤에야 알게 되고, 그때는 빈 기기 화면을 보고 떠난다.
16
+ */
17
+ id: "macro",
18
+ name: "매크로",
19
+ path: "/macro",
20
+ description: "앱·게임·웹에서 매일 하는 조작을 정한 시각에 대신 눌러 줍니다. 윈도우 PC 한 대가 필요합니다.",
21
+ iconPath: "M13 2 3 14h7l-1 8 10-12h-7l1-8z",
22
+ requiresAuth: true
23
+ },
24
+ {
25
+ /**
26
+ * 에이전트 — 다른 서비스와 성격이 다르다. macro 는 loafacto.com 안에서 돌지만
27
+ * 에이전트의 런타임은 **고객의 팀 서버**에서 돈다(폐쇄망·로컬 LLM 이 전제다).
28
+ * 이 경로는 시연과 내려받기를 맡는다. 저장소는 loafacto-agent.
29
+ *
30
+ * 지금 올라가 있는 것은 「작업대 만들기」 흐름의 목업이다. 표시 없이 두면 사용자가
31
+ * 완성품으로 읽고 눌리지 않는 버튼을 버그로 신고한다.
32
+ */
33
+ id: "agent",
34
+ name: "에이전트",
35
+ path: "/agent",
36
+ description: "화면에서 고른 것만 에이전트에게 시키는 작업대",
37
+ badge: "목업",
38
+ iconPath: "M12 2a2 2 0 0 1 2 2v1h3a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h3V4a2 2 0 0 1 2-2zm-3 9a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm6 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z",
39
+ requiresAuth: true
40
+ }
41
+ ];
42
+ function isUnder(pathname, servicePath) {
43
+ return pathname === servicePath || pathname.startsWith(`${servicePath}/`);
44
+ }
45
+ function serviceIdForPath(pathname, services = LOAFACTO_SERVICES) {
46
+ var _a;
47
+ return (_a = services.find((s) => isUnder(pathname, s.path))) == null ? void 0 : _a.id;
48
+ }
49
+ function isServicePath(pathname, services = LOAFACTO_SERVICES) {
50
+ return services.some((s) => isUnder(pathname, s.path));
51
+ }
5
52
  const STORAGE_KEY = "lf-theme";
6
53
  const OS_QUERY = "(prefers-color-scheme: light)";
7
54
  function readStored() {
@@ -199,7 +246,7 @@ const ICON_MOON = "M12.3 3a7 7 0 1 0 8.7 8.7A9 9 0 1 1 12.3 3z";
199
246
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
200
247
  __name: "AppShell",
201
248
  props: {
202
- services: { default: () => [] },
249
+ services: { default: () => LOAFACTO_SERVICES },
203
250
  currentServiceId: {},
204
251
  shortcuts: { default: () => [] },
205
252
  themeToggle: { type: Boolean, default: true },
@@ -454,7 +501,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
454
501
  };
455
502
  }
456
503
  });
457
- const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-e58d11d0"]]);
504
+ const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-513c839a"]]);
458
505
  function generateId() {
459
506
  return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
460
507
  }
@@ -2674,6 +2721,7 @@ export {
2674
2721
  b as DEFAULT_THEME,
2675
2722
  LF_ICONS,
2676
2723
  LIGHT_THEME,
2724
+ LOAFACTO_SERVICES,
2677
2725
  LfAlert,
2678
2726
  LfAvatar,
2679
2727
  LfBadge,
@@ -2708,7 +2756,9 @@ export {
2708
2756
  h as hexToRgb,
2709
2757
  initTheme,
2710
2758
  i as isLightBackground,
2759
+ isServicePath,
2711
2760
  l as luminance,
2761
+ serviceIdForPath,
2712
2762
  useConfirm,
2713
2763
  useConfirmStore,
2714
2764
  useLoadingStore,