@iyulab/modern-app 0.2.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
4
- -
3
+ ## 0.2.1 (2025-11-13)
4
+ - Fixed few component and sidebar styles
5
+ - removed `theme` setter property in `app` instance
6
+ - changed `progress` property to function in `app` instance
7
+ - changed name `locales` option to `localization` option in `AppConfig` type
5
8
 
6
9
  ## 0.2.0 (2025-11-12)
7
10
  - Initial library version release
package/dist/app.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { Router } from '@iyulab/router';
2
- import { ThemeType } from '@iyulab/components/dist/utilities/theme.js';
3
2
  import { AppConfig } from './types/AppConfigs.js';
4
- import { DialogOptions, NotificationOptions } from './types/AppOptions.js';
3
+ import { NotificationOptions } from './types/AppOptions.js';
5
4
  /**
6
5
  * 애플리케이션 전역 상태 및 설정 관리 클래스
7
6
  */
@@ -17,28 +16,30 @@ declare class App {
17
16
  get config(): AppConfig | undefined;
18
17
  /** 라우터 인스턴스 반환 */
19
18
  get router(): Router | undefined;
20
- /** 스타일 테마 반환 */
21
- get theme(): ThemeType;
22
- /** 스타일 테마 설정 */
23
- set theme(value: ThemeType);
24
- /** 현재 진행바 설정 */
25
- set progress(value: number);
19
+ /** 스타일 테마 관리 유틸리티 객체 반환 */
20
+ get theme(): import('@iyulab/components/dist/utilities/theme.js').Theme;
21
+ /** 현재 언어 코드 반환 (i18next.language) */
22
+ get language(): string;
26
23
  /** 앱 로드 및 초기화 */
27
24
  load(config: AppConfig): Promise<void>;
28
25
  /** 앱 언로드 */
29
26
  unload(): void;
30
27
  /** 페이지 이동 */
31
28
  navigate(path: string): void;
29
+ /** 언어 설정 변경(i18next.changeLanguage 호출) */
30
+ setLanguage(lang: string): Promise<void>;
31
+ /** 레이아웃 진행바 설정 */
32
+ progress(value: number): void;
33
+ /** 공지 메시지 */
34
+ notice(message: string, options?: NotificationOptions): Promise<void>;
35
+ /** 정보 메시지 */
36
+ info(message: string, options?: NotificationOptions): Promise<void>;
37
+ /** 경고 메시지 */
38
+ warning(message: string, options?: NotificationOptions): Promise<void>;
32
39
  /** 성공 메시지 */
33
40
  success(message: string, options?: NotificationOptions): Promise<void>;
34
41
  /** 에러 메시지 */
35
42
  error(message: string, options?: NotificationOptions): Promise<void>;
36
- /** 경고 메시지 */
37
- warning(message: string, options?: NotificationOptions): Promise<void>;
38
- /** 정보 메시지 */
39
- info(message: string, options?: NotificationOptions): Promise<void>;
40
- /** 확인 대화상자 */
41
- confirm(message: string, _options?: DialogOptions): Promise<boolean>;
42
43
  /** 레이아웃 생성 */
43
44
  private createLayout;
44
45
  /** 알림 표시 */
package/dist/app.js CHANGED
@@ -1,22 +1,22 @@
1
- import { runInAction as a } from "mobx";
2
- import u from "i18next";
3
- import { Router as c } from "@iyulab/router";
4
- import { notifier as d } from "@iyulab/components/dist/utilities/notifier.js";
5
- import { theme as r } from "@iyulab/components/dist/utilities/theme.js";
6
- import { screen as n, progress as h } from "./internals/observers.js";
7
- class i {
1
+ import { runInAction as r } from "mobx";
2
+ import n from "i18next";
3
+ import { Router as l } from "@iyulab/router";
4
+ import { notifier as c } from "@iyulab/components/dist/utilities/notifier.js";
5
+ import { theme as u } from "@iyulab/components/dist/utilities/theme.js";
6
+ import { screen as s, progress as d } from "./internals/observables.js";
7
+ class o {
8
8
  // private 생성자로 외부에서 인스턴스 생성 방지
9
9
  constructor() {
10
10
  this.handleWindowResize = (t) => {
11
- const e = window.innerWidth, [o, s] = this._config?.layout.breakpoints || [768, 1024];
12
- a(() => {
13
- e < o ? n.set("small") : e < s ? n.set("medium") : n.set("large");
11
+ const e = window.innerWidth, [i, a] = this._config?.layout.breakpoints || [768, 1024];
12
+ r(() => {
13
+ e < i ? s.set("small") : e < a ? s.set("medium") : s.set("large");
14
14
  });
15
15
  };
16
16
  }
17
17
  /** 싱글톤 인스턴스 반환 */
18
18
  static get instance() {
19
- return i._instance || (i._instance = new i()), i._instance;
19
+ return o._instance || (o._instance = new o()), o._instance;
20
20
  }
21
21
  /** 현재 앱 설정 반환 */
22
22
  get config() {
@@ -26,31 +26,22 @@ class i {
26
26
  get router() {
27
27
  return this._router;
28
28
  }
29
- /** 스타일 테마 반환 */
29
+ /** 스타일 테마 관리 유틸리티 객체 반환 */
30
30
  get theme() {
31
- const t = r.get();
32
- if (!t)
33
- throw new Error("No theme is set, cannot get theme.");
34
- return t;
35
- }
36
- /** 스타일 테마 설정 */
37
- set theme(t) {
38
- r.set(t);
39
- }
40
- /** 현재 진행바 설정 */
41
- set progress(t) {
42
- a(() => {
43
- h.set(t);
44
- });
31
+ return u;
32
+ }
33
+ /** 현재 언어 코드 반환 (i18next.language) */
34
+ get language() {
35
+ return n.language;
45
36
  }
46
37
  /** 앱 로드 및 초기화 */
47
38
  async load(t) {
48
- if (this.unload(), this._config = t, r.init(t.theme), t.locales) {
49
- for (const e of t.locales.plugins || [])
50
- u.use(e);
51
- await u.init(t.locales);
39
+ if (this.unload(), this._config = t, await u.init(t.theme), t.localization) {
40
+ for (const e of t.localization.plugins || [])
41
+ n.use(e);
42
+ await n.init(t.localization);
52
43
  }
53
- window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize(new Event("resize")), this._root = await this.createLayout(t.layout), this._router = new c({
44
+ window.addEventListener("resize", this.handleWindowResize), this.handleWindowResize(new Event("resize")), this._root = await this.createLayout(t.layout), this._router = new l({
54
45
  root: this._root,
55
46
  basepath: t.basepath,
56
47
  routes: t.routes
@@ -64,48 +55,58 @@ class i {
64
55
  navigate(t) {
65
56
  this._router?.go(t);
66
57
  }
67
- /** 성공 메시지 */
68
- async success(t, e) {
69
- await this.notify("success", t, e);
58
+ /** 언어 설정 변경(i18next.changeLanguage 호출) */
59
+ async setLanguage(t) {
60
+ await n.changeLanguage(t);
70
61
  }
71
- /** 에러 메시지 */
72
- async error(t, e) {
73
- await this.notify("error", t, e);
62
+ /** 레이아웃 진행바 설정 */
63
+ progress(t) {
64
+ r(() => {
65
+ d.set(t);
66
+ });
74
67
  }
75
- /** 경고 메시지 */
76
- async warning(t, e) {
77
- await this.notify("warning", t, e);
68
+ /** 공지 메시지 */
69
+ async notice(t, e) {
70
+ await this.notify("notice", t, e);
78
71
  }
79
72
  /** 정보 메시지 */
80
73
  async info(t, e) {
81
74
  await this.notify("info", t, e);
82
75
  }
83
- /** 확인 대화상자 */
84
- async confirm(t, e) {
85
- return window.confirm(t);
76
+ /** 경고 메시지 */
77
+ async warning(t, e) {
78
+ await this.notify("warning", t, e);
79
+ }
80
+ /** 성공 메시지 */
81
+ async success(t, e) {
82
+ await this.notify("success", t, e);
83
+ }
84
+ /** 에러 메시지 */
85
+ async error(t, e) {
86
+ await this.notify("error", t, e);
86
87
  }
87
88
  /** 레이아웃 생성 */
88
89
  async createLayout(t) {
89
90
  let e = document.body.querySelector("[data-layout]");
90
91
  if (e && document.body.removeChild(e), t.type === "sidebar") {
91
- const { SidebarLayout: o } = await import("./layouts/SidebarLayout.js"), s = new o();
92
- s.config = t, e = s;
92
+ const { SidebarLayout: i } = await import("./layouts/SidebarLayout.js"), a = new i();
93
+ a.config = t, e = a;
93
94
  } else
94
95
  throw new Error(`Unsupported layout type: ${t.type}`);
95
96
  return e.setAttribute("data-layout", "true"), document.body.appendChild(e), "updateComplete" in e && await e.updateComplete, e;
96
97
  }
97
98
  /** 알림 표시 */
98
- async notify(t, e, o) {
99
- await d.toast({
99
+ async notify(t, e, i) {
100
+ await c.toast({
100
101
  type: t,
101
102
  content: e,
102
- label: o?.title,
103
- duration: o?.duration || 3e3,
104
- position: o?.position || "top-right"
103
+ label: i?.title,
104
+ duration: i?.duration || 3e3,
105
+ position: i?.position || "top-right"
105
106
  });
106
107
  }
107
108
  }
108
- const _ = i.instance;
109
+ const g = o.instance;
109
110
  export {
110
- _ as app
111
+ g as app
111
112
  };
@@ -36,7 +36,5 @@ export declare class SidebarLink extends ExtendedBaseElement<ElementParts> {
36
36
  render(): import('lit-html').TemplateResult<1>;
37
37
  /** 라우트 변경 이벤트 핸들러 */
38
38
  private handleRouteBegin;
39
- /** 라우트 변경 이벤트 핸들러 */
40
- private handleRouteDone;
41
39
  }
42
40
  export {};
@@ -1,37 +1,35 @@
1
- import { html as l } from "lit";
2
- import { property as t } from "lit/decorators.js";
3
- import { Icon as c } from "@iyulab/components/dist/components/Icon/Icon.js";
4
- import { ExtendedBaseElement as d } from "../internals/ExtendedBaseElement.js";
5
- import { styles as h } from "./SidebarLink.styles.js";
6
- var u = Object.defineProperty, n = (r, i, a, f) => {
7
- for (var e = void 0, s = r.length - 1, p; s >= 0; s--)
8
- (p = r[s]) && (e = p(i, a, e) || e);
9
- return e && u(i, a, e), e;
1
+ import { html as c } from "lit";
2
+ import { property as e } from "lit/decorators.js";
3
+ import { Icon as l } from "@iyulab/components/dist/components/Icon/Icon.js";
4
+ import { ExtendedBaseElement as h } from "../internals/ExtendedBaseElement.js";
5
+ import { styles as d } from "./SidebarLink.styles.js";
6
+ var u = Object.defineProperty, n = (o, r, a, f) => {
7
+ for (var t = void 0, s = o.length - 1, p; s >= 0; s--)
8
+ (p = o[s]) && (t = p(r, a, t) || t);
9
+ return t && u(r, a, t), t;
10
10
  };
11
- class o extends d {
11
+ class i extends h {
12
12
  constructor() {
13
- super(...arguments), this.selected = !1, this.compact = !1, this.handleRouteBegin = (i) => {
14
- this.selected = !1;
15
- }, this.handleRouteDone = (i) => {
16
- this.pattern ||= this.href, this.pattern ? (this.pattern = typeof this.pattern == "string" ? new URLPattern(this.pattern, window.location.origin) : this.pattern, this.selected = this.pattern.test(i.routeInfo.path, window.location.origin)) : this.selected = !1;
13
+ super(...arguments), this.selected = !1, this.compact = !1, this.handleRouteBegin = (r) => {
14
+ this.pattern ||= this.href, this.pattern ? (this.pattern = typeof this.pattern == "string" ? new URLPattern(this.pattern, window.location.origin) : this.pattern, this.selected = this.pattern.test(r.routeInfo.path, window.location.origin)) : this.selected = !1;
17
15
  };
18
16
  }
19
17
  static {
20
- this.styles = [super.styles, h];
18
+ this.styles = [super.styles, d];
21
19
  }
22
20
  static {
23
21
  this.dependencies = {
24
- "u-icon": c
22
+ "u-icon": l
25
23
  };
26
24
  }
27
25
  connectedCallback() {
28
- super.connectedCallback(), window.addEventListener("route-begin", this.handleRouteBegin), window.addEventListener("route-done", this.handleRouteDone);
26
+ super.connectedCallback(), window.addEventListener("route-begin", this.handleRouteBegin);
29
27
  }
30
28
  disconnectedCallback() {
31
- window.removeEventListener("route-begin", this.handleRouteBegin), window.removeEventListener("route-done", this.handleRouteDone), super.disconnectedCallback();
29
+ window.removeEventListener("route-begin", this.handleRouteBegin), super.disconnectedCallback();
32
30
  }
33
31
  render() {
34
- return l`
32
+ return c`
35
33
  <u-link part="base"
36
34
  .href=${this.href || "#"}
37
35
  ?compact=${this.compact}>
@@ -49,23 +47,23 @@ class o extends d {
49
47
  }
50
48
  }
51
49
  n([
52
- t({ type: Boolean, reflect: !0 })
53
- ], o.prototype, "selected");
50
+ e({ type: Boolean, reflect: !0 })
51
+ ], i.prototype, "selected");
54
52
  n([
55
- t({ type: Boolean })
56
- ], o.prototype, "compact");
53
+ e({ type: Boolean })
54
+ ], i.prototype, "compact");
57
55
  n([
58
- t({ type: String })
59
- ], o.prototype, "icon");
56
+ e({ type: String })
57
+ ], i.prototype, "icon");
60
58
  n([
61
- t({ type: String })
62
- ], o.prototype, "label");
59
+ e({ type: String })
60
+ ], i.prototype, "label");
63
61
  n([
64
- t({ type: String })
65
- ], o.prototype, "href");
62
+ e({ type: String })
63
+ ], i.prototype, "href");
66
64
  n([
67
- t({ type: String })
68
- ], o.prototype, "pattern");
65
+ e({ type: String })
66
+ ], i.prototype, "pattern");
69
67
  export {
70
- o as SidebarLink
68
+ i as SidebarLink
71
69
  };
@@ -1,19 +1,19 @@
1
- import { nothing as m, html as n } from "lit";
1
+ import { nothing as m, html as s } from "lit";
2
2
  import { property as e } from "lit/decorators.js";
3
3
  import { Icon as l } from "@iyulab/components/dist/components/icon/Icon.js";
4
- import { ExtendedBaseElement as y } from "../internals/ExtendedBaseElement.js";
5
- import { styles as h } from "./SidebarLogo.styles.js";
6
- var d = Object.defineProperty, i = (r, s, a, g) => {
4
+ import { ExtendedBaseElement as h } from "../internals/ExtendedBaseElement.js";
5
+ import { styles as y } from "./SidebarLogo.styles.js";
6
+ var d = Object.defineProperty, i = (r, n, a, g) => {
7
7
  for (var t = void 0, p = r.length - 1, c; p >= 0; p--)
8
- (c = r[p]) && (t = c(s, a, t) || t);
9
- return t && d(s, a, t), t;
8
+ (c = r[p]) && (t = c(n, a, t) || t);
9
+ return t && d(n, a, t), t;
10
10
  };
11
- class o extends y {
11
+ class o extends h {
12
12
  constructor() {
13
13
  super(...arguments), this.compact = !1, this.type = "icon";
14
14
  }
15
15
  static {
16
- this.styles = [super.styles, h];
16
+ this.styles = [super.styles, y];
17
17
  }
18
18
  static {
19
19
  this.dependencies = {
@@ -21,13 +21,14 @@ class o extends y {
21
21
  };
22
22
  }
23
23
  render() {
24
- return n`
24
+ return s`
25
25
  <div class="container" part="container">
26
- ${this.type === "image" && this.image ? n`
26
+ ${this.type === "image" && this.image ? s`
27
27
  <img part="image"
28
+ ?compact=${this.compact}
28
29
  src=${this.image}
29
30
  alt="App Logo"
30
- />` : this.type === "icon" && this.icon ? n`
31
+ />` : this.type === "icon" && this.icon ? s`
31
32
  <u-icon part="icon"
32
33
  .remote=${!0}
33
34
  .name=${this.icon}
@@ -26,11 +26,15 @@ const t = e`
26
26
  }
27
27
 
28
28
  img {
29
- width: 100%;
29
+ width: auto;
30
30
  height: 1em;
31
31
  object-fit: contain;
32
32
  flex-shrink: 0;
33
33
  }
34
+ img[compact] {
35
+ width: 1em;
36
+ height: auto;
37
+ }
34
38
 
35
39
  u-icon {
36
40
  font-size: 1em;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ import { app } from './app';
1
2
  export type * from './types/AppConfigs.js';
2
3
  export type * from './types/AppOptions.js';
3
4
  export type * from './types/AppTypes.js';
4
5
  export { app } from './app';
6
+ export default app;
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { app as r } from "./app.js";
1
+ import { app as a } from "./app.js";
2
2
  export {
3
- r as app
3
+ a as app,
4
+ a as default
4
5
  };
@@ -1,5 +1,6 @@
1
1
  import { IObservableValue } from 'mobx';
2
- import { ScreenSize } from '../types/AppTypes';
2
+ /** 화면 크기 타입 */
3
+ export type ScreenSize = 'small' | 'medium' | 'large';
3
4
  /**
4
5
  * 현재 화면 크기 상태
5
6
  */
@@ -1,8 +1,7 @@
1
- import { nothing, PropertyValues, TemplateResult } from 'lit';
1
+ import { nothing, PropertyValues } from 'lit';
2
2
  import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
3
3
  import { ExtendedBaseElement } from '../internals/ExtendedBaseElement';
4
4
  import { ProgressBar } from '../components/ProgressBar';
5
- import { UnsafeContent } from '../components/UnsafeContent';
6
5
  import { SidebarLogo } from '../components/SidebarLogo';
7
6
  import { SidebarSection } from '../components/SidebarSection';
8
7
  import { SidebarGroup } from '../components/SidebarGroup';
@@ -13,7 +12,6 @@ import { SidebarLayoutConfig, SidebarState, SidebarParts } from './SidebarLayout
13
12
  declare global {
14
13
  interface HTMLElementTagNameMap {
15
14
  'u-progress-bar': ProgressBar;
16
- 'u-unsafe-content': UnsafeContent;
17
15
  'u-sidebar-logo': SidebarLogo;
18
16
  'u-sidebar-section': SidebarSection;
19
17
  'u-sidebar-group': SidebarGroup;
@@ -45,7 +43,7 @@ export declare class SidebarLayout extends ExtendedBaseElement<SidebarParts> {
45
43
  connectedCallback(): void;
46
44
  disconnectedCallback(): void;
47
45
  protected updated(changedProperties: PropertyValues): void;
48
- render(): TemplateResult<1> | typeof nothing;
46
+ render(): import('lit-html').TemplateResult<1> | typeof nothing;
49
47
  /** 사이드바 아이템 렌더링 */
50
48
  private renderItem;
51
49
  /** 화면 크기 변경에 따른 사이드바 상태 업데이트 */
@@ -56,5 +54,5 @@ export declare class SidebarLayout extends ExtendedBaseElement<SidebarParts> {
56
54
  * 모달 상태에서 사이드바 닫기
57
55
  * 백드롭 클릭 or 라우트 변경 시
58
56
  */
59
- private handleCloseModal;
57
+ private toggleStateIfModalState;
60
58
  }
@@ -1,44 +1,44 @@
1
- import { nothing as u, html as i } from "lit";
2
- import { query as h, state as f, property as m, customElement as g } from "lit/decorators.js";
1
+ import { nothing as p, html as i } from "lit";
2
+ import { query as f, state as b, property as h, customElement as m } from "lit/decorators.js";
3
3
  import { repeat as l } from "lit/directives/repeat.js";
4
- import { autorun as b } from "mobx";
4
+ import { autorun as g } from "mobx";
5
5
  import { IconButton as $ } from "@iyulab/components/dist/components/icon-button/IconButton.js";
6
- import { screen as p, progress as y } from "../internals/observers.js";
6
+ import { screen as u, progress as y } from "../internals/observables.js";
7
7
  import { ExtendedBaseElement as v } from "../internals/ExtendedBaseElement.js";
8
- import { ProgressBar as _ } from "../components/ProgressBar.js";
9
- import { UnsafeContent as S } from "../components/UnsafeContent.js";
10
- import { SidebarLogo as k } from "../components/SidebarLogo.js";
11
- import { SidebarSection as C } from "../components/SidebarSection.js";
8
+ import { ProgressBar as S } from "../components/ProgressBar.js";
9
+ import { SidebarLogo as _ } from "../components/SidebarLogo.js";
10
+ import { SidebarSection as k } from "../components/SidebarSection.js";
12
11
  import { SidebarGroup as w } from "../components/SidebarGroup.js";
13
- import { SidebarLink as E } from "../components/SidebarLink.js";
14
- import { SidebarButton as O } from "../components/SidebarButton.js";
15
- import { styles as I } from "./SidebarLayout.styles.js";
16
- var M = Object.defineProperty, P = Object.getOwnPropertyDescriptor, z = Object.getPrototypeOf, B = Reflect.get, n = (e, t, s, a) => {
17
- for (var r = a > 1 ? void 0 : a ? P(t, s) : t, d = e.length - 1, c; d >= 0; d--)
12
+ import { SidebarLink as I } from "../components/SidebarLink.js";
13
+ import { SidebarButton as E } from "../components/SidebarButton.js";
14
+ import { styles as C } from "./SidebarLayout.styles.js";
15
+ import { unsafeHTML as O } from "lit/directives/unsafe-html.js";
16
+ var M = Object.defineProperty, L = Object.getOwnPropertyDescriptor, P = Object.getPrototypeOf, B = Reflect.get, n = (e, t, s, a) => {
17
+ for (var r = a > 1 ? void 0 : a ? L(t, s) : t, d = e.length - 1, c; d >= 0; d--)
18
18
  (c = e[d]) && (r = (a ? c(t, s, r) : c(r)) || r);
19
19
  return a && r && M(t, s, r), r;
20
- }, L = (e, t, s) => B(z(e), s, t);
20
+ }, j = (e, t, s) => B(P(e), s, t);
21
21
  let o = class extends v {
22
22
  constructor() {
23
23
  super(...arguments), this.disposers = [], this.state = "docked", this.toggleState = () => {
24
- const e = p.get();
24
+ const e = u.get();
25
25
  e === "large" ? this.state = this.state === "docked" ? "slim" : "docked" : e === "medium" ? this.state = this.state === "slim" ? "modal" : "slim" : e === "small" ? this.state = this.state === "closed" ? "modal" : "closed" : console.warn("Unknown screen size:", e);
26
- }, this.handleCloseModal = () => {
27
- const e = p.get();
26
+ }, this.toggleStateIfModalState = () => {
27
+ const e = u.get();
28
28
  this.state === "modal" && (e === "medium" ? this.state = "slim" : e === "small" && (this.state = "closed"));
29
29
  };
30
30
  }
31
31
  connectedCallback() {
32
- super.connectedCallback(), this.disposers.push(b(() => {
33
- const e = p.get();
32
+ super.connectedCallback(), this.disposers.push(g(() => {
33
+ const e = u.get();
34
34
  this.updateState(e);
35
- })), this.disposers.push(b(() => {
35
+ })), this.disposers.push(g(() => {
36
36
  const e = y.get();
37
37
  this.progressEl && (this.progressEl.value = e);
38
- })), window.addEventListener("route-begin", this.handleCloseModal);
38
+ })), window.addEventListener("route-begin", this.toggleStateIfModalState);
39
39
  }
40
40
  disconnectedCallback() {
41
- this.disposers.forEach((e) => e()), window.removeEventListener("route-begin", this.handleCloseModal), super.disconnectedCallback();
41
+ this.disposers.forEach((e) => e()), window.removeEventListener("route-begin", this.toggleStateIfModalState), super.disconnectedCallback();
42
42
  }
43
43
  updated(e) {
44
44
  super.updated(e), e.has("config") && (this.styles = this.config?.styles);
@@ -74,7 +74,8 @@ let o = class extends v {
74
74
  </nav>
75
75
 
76
76
  <!-- Sidebar Footer -->
77
- <div class="sidebar-footer" part="sidebar-footer">
77
+ <div class="sidebar-footer" part="sidebar-footer"
78
+ ?hidden="${!this.config.footer || this.config.footer.length === 0}">
78
79
  ${l(
79
80
  this.config.footer ?? [],
80
81
  (e, t) => t,
@@ -93,26 +94,20 @@ let o = class extends v {
93
94
  <!-- Backdrop for modal state -->
94
95
  <div class="backdrop"
95
96
  ?hidden="${this.state !== "modal"}"
96
- @click="${this.handleCloseModal}"
97
+ @click="${this.toggleStateIfModalState}"
97
98
  ></div>
98
- ` : u;
99
+ ` : p;
99
100
  }
100
101
  /** 사이드바 아이템 렌더링 */
101
102
  renderItem(e) {
102
- return e ? e.type === "group" ? i`
103
- <u-sidebar-group
103
+ return e ? e.type === "content" ? this.state === "slim" ? p : O(e.content) : e.type === "button" ? i`
104
+ <u-sidebar-button
104
105
  ?compact=${this.state === "slim"}
105
- ?collapsed="${e.collapsed ?? !1}"
106
106
  .icon="${e.icon}"
107
107
  .label="${e.label}"
108
- .items="${e.items}"
109
- .styles="${e.styles}">
110
- ${l(
111
- e.items,
112
- (t, s) => s,
113
- (t, s) => this.renderItem(t)
114
- )}
115
- </u-sidebar-group>
108
+ .styles="${e.styles}"
109
+ @click="${e.onClick}"
110
+ ></u-sidebar-button>
116
111
  ` : e.type === "section" ? i`
117
112
  <u-sidebar-section
118
113
  ?compact=${this.state === "slim"}
@@ -126,19 +121,20 @@ let o = class extends v {
126
121
  (t, s) => this.renderItem(t)
127
122
  )}
128
123
  </u-sidebar-section>
129
- ` : e.type === "button" ? i`
130
- <u-sidebar-button
124
+ ` : e.type === "group" ? i`
125
+ <u-sidebar-group
131
126
  ?compact=${this.state === "slim"}
127
+ ?collapsed="${e.collapsed ?? !1}"
132
128
  .icon="${e.icon}"
133
129
  .label="${e.label}"
134
- .styles="${e.styles}"
135
- @click="${e.onClick}"
136
- ></u-sidebar-button>
137
- ` : e.type === "content" ? i`
138
- <u-sidebar-content
139
- ?compact=${this.state === "slim"}
140
- .content="${e.content}"
141
- ></u-sidebar-content>
130
+ .items="${e.items}"
131
+ .styles="${e.styles}">
132
+ ${l(
133
+ e.items,
134
+ (t, s) => s,
135
+ (t, s) => this.renderItem(t)
136
+ )}
137
+ </u-sidebar-group>
142
138
  ` : i`
143
139
  <u-sidebar-link
144
140
  ?compact=${this.state === "slim"}
@@ -148,35 +144,34 @@ let o = class extends v {
148
144
  .pattern="${e.pattern}"
149
145
  .styles="${e.styles}"
150
146
  ></u-sidebar-link>
151
- ` : u;
147
+ ` : p;
152
148
  }
153
149
  /** 화면 크기 변경에 따른 사이드바 상태 업데이트 */
154
150
  updateState(e) {
155
151
  e === "large" ? this.state = "docked" : e === "medium" ? this.state = "slim" : e === "small" ? this.state = "closed" : console.warn("Unknown screen size:", e);
156
152
  }
157
153
  };
158
- o.styles = [L(o, o, "styles"), I];
154
+ o.styles = [j(o, o, "styles"), C];
159
155
  o.dependencies = {
160
156
  "u-icon-button": $,
161
- "u-progress-bar": _,
162
- "u-unsafe-content": S,
163
- "u-sidebar-logo": k,
164
- "u-sidebar-section": C,
157
+ "u-progress-bar": S,
158
+ "u-sidebar-logo": _,
159
+ "u-sidebar-section": k,
165
160
  "u-sidebar-group": w,
166
- "u-sidebar-link": E,
167
- "u-sidebar-button": O
161
+ "u-sidebar-link": I,
162
+ "u-sidebar-button": E
168
163
  };
169
164
  n([
170
- h("u-progress-bar")
165
+ f("u-progress-bar")
171
166
  ], o.prototype, "progressEl", 2);
172
167
  n([
173
- f()
168
+ b()
174
169
  ], o.prototype, "state", 2);
175
170
  n([
176
- m({ type: Object })
171
+ h({ type: Object })
177
172
  ], o.prototype, "config", 2);
178
173
  o = n([
179
- g("app-sidebar-layout")
174
+ m("app-sidebar-layout")
180
175
  ], o);
181
176
  export {
182
177
  o as SidebarLayout
@@ -4,13 +4,17 @@ import { SidebarLinkConfig } from '../components/SidebarLink';
4
4
  import { SidebarSectionConfig } from '../components/SidebarSection';
5
5
  import { SidebarGroupConfig } from '../components/SidebarGroup';
6
6
  import { SidebarButtonConfig } from '../components/SidebarButton';
7
- import { UnsafeContentConfig } from '../components/UnsafeContent';
8
7
  /** 사이드바 레이아웃 컴포넌트의 요소(part) 타입 */
9
8
  export type SidebarParts = 'host' | 'sidebar' | 'sidebar-toggler' | 'sidebar-header' | 'sidebar-menu' | 'sidebar-footer' | 'main' | 'progress';
10
9
  /** 사이드바 상태 타입 */
11
10
  export type SidebarState = 'docked' | 'modal' | 'slim' | 'closed';
11
+ /** 사이드바 컨텐츠 커스텀 HTML 타입 */
12
+ export interface SidebarContentConfig {
13
+ type: 'content';
14
+ content: string;
15
+ }
12
16
  /** union: section | group | link | button */
13
- export type SidebarItem = (SidebarLinkConfig | SidebarSectionConfig | SidebarGroupConfig | SidebarButtonConfig | UnsafeContentConfig);
17
+ export type SidebarItem = (SidebarLinkConfig | SidebarSectionConfig | SidebarGroupConfig | SidebarButtonConfig | SidebarContentConfig);
14
18
  /** 사이드바 전체 설정 (루트) */
15
19
  export interface SidebarLayoutConfig {
16
20
  type: 'sidebar';
@@ -5,7 +5,7 @@ import { SidebarLayoutConfig } from '../layouts/SidebarLayout.types';
5
5
  /**
6
6
  * i18next의 초기화 옵션과 플러그인 배열을 포함한 다국어 설정
7
7
  */
8
- export type LocaleInitOptions = InitOptions & {
8
+ export type LocalizationInitOptions = InitOptions & {
9
9
  /**
10
10
  * i18next 플러그인 배열
11
11
  * @description i18next.use() 메서드에 전달될 플러그인들의 배열입니다.
@@ -45,7 +45,7 @@ export interface AppConfig {
45
45
  * @description i18next의 InitOptions와 플러그인 배열을 포함합니다. i18next를 사용하지 않는 경우 이 설정은 생략할 수 있습니다.
46
46
  * @see 설정에 대한 자세한 내용은 {@link https://www.i18next.com/overview/configuration-options} 참조하십시오.
47
47
  */
48
- locales?: LocaleInitOptions;
48
+ localization?: LocalizationInitOptions;
49
49
  /**
50
50
  * 애플리케이션을 구성하기 위한 레이아웃 설정
51
51
  * @description 현재는 사이드바 레이아웃만 지원합니다.
@@ -1,5 +1,3 @@
1
- /** 화면 크기 타입 */
2
- export type ScreenSize = 'small' | 'medium' | 'large';
3
1
  /** 스타일 값 타입 */
4
2
  export type StyleValue = Record<string, string> | Partial<CSSStyleDeclaration>;
5
3
  /** 스타일 맵 타입 */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iyulab/modern-app",
3
3
  "description": "web-framework by iyulab based on react, lit-element",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "keywords": [
6
6
  "iyulab",
7
7
  "web-framework",
@@ -29,7 +29,7 @@
29
29
  "import": "./dist/index.js"
30
30
  },
31
31
  "./dist/*": {
32
- "types": "./dist/*",
32
+ "types": "./dist/*.d.ts",
33
33
  "import": "./dist/*"
34
34
  }
35
35
  },
@@ -38,8 +38,8 @@
38
38
  "build": "vite build"
39
39
  },
40
40
  "dependencies": {
41
- "@iyulab/components": "^0.1.0",
42
- "@iyulab/router": "^0.5.0",
41
+ "@iyulab/components": "^0.1.2",
42
+ "@iyulab/router": "^0.5.1",
43
43
  "lit": "^3.3.1",
44
44
  "mobx": "^6.15.0",
45
45
  "i18next": "^25.6.2"
@@ -1,16 +0,0 @@
1
- import { BaseElement } from '@iyulab/components/dist/components/BaseElement.js';
2
- /** Raw HTML content */
3
- export interface UnsafeContentConfig {
4
- type: 'content';
5
- content: string;
6
- }
7
- /**
8
- * 일반 HTML 콘텐츠를 표시하는 사이드바 컴포넌트
9
- */
10
- export declare class UnsafeContent extends BaseElement {
11
- static styles: import('lit').CSSResultGroup[];
12
- static dependencies: Record<string, typeof BaseElement>;
13
- /** HTML 콘텐츠 */
14
- content?: string;
15
- render(): import('lit-html/directive.js').DirectiveResult<typeof import('lit-html/directives/unsafe-html.js').UnsafeHTMLDirective>;
16
- }
@@ -1,26 +0,0 @@
1
- import { property as i } from "lit/decorators.js";
2
- import { unsafeHTML as p } from "lit/directives/unsafe-html.js";
3
- import { BaseElement as f } from "@iyulab/components/dist/components/BaseElement.js";
4
- import { styles as a } from "./UnsafeContent.styles.js";
5
- var m = Object.defineProperty, l = (t, s, n, c) => {
6
- for (var e = void 0, r = t.length - 1, o; r >= 0; r--)
7
- (o = t[r]) && (e = o(s, n, e) || e);
8
- return e && m(s, n, e), e;
9
- };
10
- class d extends f {
11
- static {
12
- this.styles = [super.styles, a];
13
- }
14
- static {
15
- this.dependencies = {};
16
- }
17
- render() {
18
- return p(this.content);
19
- }
20
- }
21
- l([
22
- i({ type: String })
23
- ], d.prototype, "content");
24
- export {
25
- d as UnsafeContent
26
- };
@@ -1 +0,0 @@
1
- export declare const styles: import('lit').CSSResult;
@@ -1,9 +0,0 @@
1
- import { css as s } from "lit";
2
- const o = s`
3
- :host {
4
- display: contents;
5
- }
6
- `;
7
- export {
8
- o as styles
9
- };
File without changes