@loafacto/ui 0.8.4 → 0.8.6

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.
@@ -13,6 +13,22 @@ type __VLS_Props = {
13
13
  themeToggle?: boolean;
14
14
  brandName?: string;
15
15
  brandHref?: string;
16
+ /**
17
+ * 사용자 메뉴의 「내 정보」가 가리키는 곳. 빈 문자열이면 항목을 내지 않는다.
18
+ *
19
+ * 기본값이 같은 오리진의 절대 경로인 것이 요점이다 — /macro 에서 눌러도 /agent 에서
20
+ * 눌러도 플랫폼의 같은 화면으로 간다. 다른 오리진에서 쓰는 서비스(아직 서브도메인인
21
+ * hub 등)는 전체 URL 을 넘긴다.
22
+ */
23
+ myPageHref?: string;
24
+ /**
25
+ * 「로그아웃」이 가리키는 곳. 빈 문자열이면 항목을 내지 않는다.
26
+ *
27
+ * 이벤트가 아니라 링크인 것은 **서비스마다 로그아웃을 구현하지 않게** 하기 위해서다.
28
+ * 세션을 발급하는 곳이 하나이므로 끊는 곳도 하나면 된다. 전체 페이지 이동이지만
29
+ * 어차피 나가는 길이고, 메모리에 남은 상태까지 확실히 비워진다.
30
+ */
31
+ logoutHref?: string;
16
32
  logoUrl?: string;
17
33
  user?: ShellUser | null;
18
34
  backgroundColor?: string;
@@ -48,6 +64,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
48
64
  themeToggle: boolean;
49
65
  brandName: string;
50
66
  brandHref: string;
67
+ myPageHref: string;
68
+ logoutHref: string;
51
69
  user: ShellUser | null;
52
70
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
53
71
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
package/dist/index.js CHANGED
@@ -157,37 +157,43 @@ const _hoisted_13 = {
157
157
  key: 1,
158
158
  class: "admin-badge admin-badge--gray"
159
159
  };
160
- const _hoisted_14 = ["aria-expanded"];
161
- const _hoisted_15 = ["src"];
162
- const _hoisted_16 = {
160
+ const _hoisted_14 = {
161
+ key: 2,
162
+ class: "admin-badge admin-badge--yellow"
163
+ };
164
+ const _hoisted_15 = ["aria-expanded"];
165
+ const _hoisted_16 = ["src"];
166
+ const _hoisted_17 = {
163
167
  key: 1,
164
168
  class: "lf-user__avatar lf-user__avatar--fallback"
165
169
  };
166
- const _hoisted_17 = { class: "lf-user__name" };
167
- const _hoisted_18 = {
170
+ const _hoisted_18 = { class: "lf-user__name" };
171
+ const _hoisted_19 = {
168
172
  key: 0,
169
173
  class: "lf-user__email"
170
174
  };
171
- const _hoisted_19 = {
175
+ const _hoisted_20 = ["href"];
176
+ const _hoisted_21 = ["href"];
177
+ const _hoisted_22 = {
172
178
  key: 3,
173
179
  class: "lf-shortcuts",
174
180
  "aria-label": "바로가기"
175
181
  };
176
- const _hoisted_20 = ["href", "title", "aria-label"];
177
- const _hoisted_21 = {
182
+ const _hoisted_23 = ["href", "title", "aria-label"];
183
+ const _hoisted_24 = {
178
184
  viewBox: "0 0 24 24",
179
185
  "aria-hidden": "true"
180
186
  };
181
- const _hoisted_22 = ["d"];
182
- const _hoisted_23 = ["title", "aria-label"];
183
- const _hoisted_24 = {
187
+ const _hoisted_25 = ["d"];
188
+ const _hoisted_26 = ["title", "aria-label"];
189
+ const _hoisted_27 = {
184
190
  viewBox: "0 0 24 24",
185
191
  "aria-hidden": "true"
186
192
  };
187
- const _hoisted_25 = ["d"];
188
- const _hoisted_26 = { class: "lf-content" };
189
- const _hoisted_27 = { class: "site-footer" };
190
- const _hoisted_28 = { class: "site-footer-inner" };
193
+ const _hoisted_28 = ["d"];
194
+ const _hoisted_29 = { class: "lf-content" };
195
+ const _hoisted_30 = { class: "site-footer" };
196
+ const _hoisted_31 = { class: "site-footer-inner" };
191
197
  const ICON_SUN = "M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0-5v3h0V2zm0 17v3h0v-3zM2 11h3v2H2v-2zm17 0h3v2h-3v-2zM4.2 4.2l2.1 2.1L4.9 7.7 2.8 5.6l1.4-1.4zm13.5 13.5 2.1 2.1-1.4 1.4-2.1-2.1 1.4-1.4zM19.8 4.2l1.4 1.4-2.1 2.1-1.4-1.4 2.1-2.1zM6.3 17.7l1.4 1.4-2.1 2.1-1.4-1.4 2.1-2.1z";
192
198
  const ICON_MOON = "M12.3 3a7 7 0 1 0 8.7 8.7A9 9 0 1 1 12.3 3z";
193
199
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
@@ -199,6 +205,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
199
205
  themeToggle: { type: Boolean, default: true },
200
206
  brandName: { default: "Loafacto" },
201
207
  brandHref: { default: "/" },
208
+ myPageHref: { default: "/me" },
209
+ logoutHref: { default: "/logout" },
202
210
  logoUrl: {},
203
211
  user: { default: null },
204
212
  backgroundColor: {},
@@ -337,7 +345,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
337
345
  }, null, 8, _hoisted_11)
338
346
  ])) : createCommentVNode("", true),
339
347
  createElementVNode("span", _hoisted_12, toDisplayString(svc.name), 1),
340
- svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13, "준비 중")) : createCommentVNode("", true)
348
+ svc.comingSoon ? (openBlock(), createElementBlock("span", _hoisted_13, "준비 중")) : svc.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(svc.badge), 1)) : createCommentVNode("", true)
341
349
  ], 10, _hoisted_9$1);
342
350
  }), 128))
343
351
  ])) : createCommentVNode("", true)
@@ -361,8 +369,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
361
369
  src: __props.user.avatarUrl,
362
370
  alt: "",
363
371
  class: "lf-user__avatar"
364
- }, null, 8, _hoisted_15)) : (openBlock(), createElementBlock("span", _hoisted_16, toDisplayString(userInitial.value), 1)),
365
- createElementVNode("span", _hoisted_17, toDisplayString(__props.user.displayName), 1),
372
+ }, null, 8, _hoisted_16)) : (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(userInitial.value), 1)),
373
+ createElementVNode("span", _hoisted_18, toDisplayString(__props.user.displayName), 1),
366
374
  _cache[6] || (_cache[6] = createElementVNode("svg", {
367
375
  class: "lf-user__caret",
368
376
  viewBox: "0 0 24 24",
@@ -373,18 +381,27 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
373
381
  fill: "currentColor"
374
382
  })
375
383
  ], -1))
376
- ], 8, _hoisted_14),
384
+ ], 8, _hoisted_15),
377
385
  userOpen.value ? (openBlock(), createElementBlock("div", {
378
386
  key: 0,
379
387
  class: "lf-user__menu",
380
388
  role: "menu",
381
389
  onClick: _cache[3] || (_cache[3] = ($event) => userOpen.value = false)
382
390
  }, [
383
- __props.user.email ? (openBlock(), createElementBlock("p", _hoisted_18, toDisplayString(__props.user.email), 1)) : createCommentVNode("", true),
384
- renderSlot(_ctx.$slots, "user-menu", {}, void 0, true)
391
+ __props.user.email ? (openBlock(), createElementBlock("p", _hoisted_19, toDisplayString(__props.user.email), 1)) : createCommentVNode("", true),
392
+ __props.myPageHref ? (openBlock(), createElementBlock("a", {
393
+ key: 1,
394
+ href: __props.myPageHref
395
+ }, "내 정보", 8, _hoisted_20)) : createCommentVNode("", true),
396
+ renderSlot(_ctx.$slots, "user-menu", {}, void 0, true),
397
+ __props.logoutHref ? (openBlock(), createElementBlock("a", {
398
+ key: 2,
399
+ class: "lf-user__logout",
400
+ href: __props.logoutHref
401
+ }, "로그아웃", 8, _hoisted_21)) : createCommentVNode("", true)
385
402
  ])) : createCommentVNode("", true)
386
403
  ], 512)) : renderSlot(_ctx.$slots, "auth-actions", {}, void 0, true, 2),
387
- __props.shortcuts.length ? (openBlock(), createElementBlock("nav", _hoisted_19, [
404
+ __props.shortcuts.length ? (openBlock(), createElementBlock("nav", _hoisted_22, [
388
405
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.shortcuts, (s) => {
389
406
  return openBlock(), createElementBlock("a", {
390
407
  key: s.id,
@@ -395,13 +412,13 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
395
412
  title: s.label,
396
413
  "aria-label": `${s.label} (새 탭에서 열림)`
397
414
  }, [
398
- (openBlock(), createElementBlock("svg", _hoisted_21, [
415
+ (openBlock(), createElementBlock("svg", _hoisted_24, [
399
416
  createElementVNode("path", {
400
417
  d: s.iconPath,
401
418
  fill: "currentColor"
402
- }, null, 8, _hoisted_22)
419
+ }, null, 8, _hoisted_25)
403
420
  ]))
404
- ], 8, _hoisted_20);
421
+ ], 8, _hoisted_23);
405
422
  }), 128))
406
423
  ])) : createCommentVNode("", true),
407
424
  __props.themeToggle ? (openBlock(), createElementBlock("button", {
@@ -413,21 +430,21 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
413
430
  onClick: _cache[4] || (_cache[4] = //@ts-ignore
414
431
  (...args) => unref(toggle) && unref(toggle)(...args))
415
432
  }, [
416
- (openBlock(), createElementBlock("svg", _hoisted_24, [
433
+ (openBlock(), createElementBlock("svg", _hoisted_27, [
417
434
  createElementVNode("path", {
418
435
  d: unref(mode2) === "dark" ? ICON_MOON : ICON_SUN,
419
436
  fill: "currentColor"
420
- }, null, 8, _hoisted_25)
437
+ }, null, 8, _hoisted_28)
421
438
  ]))
422
- ], 8, _hoisted_23)) : createCommentVNode("", true),
439
+ ], 8, _hoisted_26)) : createCommentVNode("", true),
423
440
  renderSlot(_ctx.$slots, "actions", {}, void 0, true)
424
441
  ])
425
442
  ]),
426
- createElementVNode("main", _hoisted_26, [
443
+ createElementVNode("main", _hoisted_29, [
427
444
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
428
445
  ]),
429
- createElementVNode("footer", _hoisted_27, [
430
- createElementVNode("div", _hoisted_28, [
446
+ createElementVNode("footer", _hoisted_30, [
447
+ createElementVNode("div", _hoisted_31, [
431
448
  renderSlot(_ctx.$slots, "footer", {}, () => [
432
449
  _cache[8] || (_cache[8] = createElementVNode("p", { class: "site-footer-copy" }, "© Loafacto. All rights reserved.", -1))
433
450
  ], true)
@@ -437,7 +454,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
437
454
  };
438
455
  }
439
456
  });
440
- const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-f1af4c05"]]);
457
+ const AppShell = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-e58d11d0"]]);
441
458
  function generateId() {
442
459
  return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
443
460
  }