ds-one 0.2.0-alpha.3 → 0.2.5-alpha.2

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.
Files changed (245) hide show
  1. package/DS1/{utils/language.ts → 0-face/i18n.ts} +197 -2
  2. package/DS1/0-face/preferences.ts +23 -0
  3. package/DS1/0-face/pricing.ts +57 -0
  4. package/DS1/1-root/one.css +1 -1
  5. package/DS1/2-core/ds-button.ts +1 -1
  6. package/DS1/2-core/ds-cycle.ts +17 -18
  7. package/DS1/2-core/{ds-year.ts → ds-date.ts} +4 -4
  8. package/DS1/2-core/ds-input.ts +1 -0
  9. package/DS1/2-core/ds-text.ts +1 -1
  10. package/DS1/2-core/ds-tooltip.ts +4 -3
  11. package/DS1/3-unit/doublenav-v1.ts +105 -0
  12. package/DS1/3-unit/{ds-doublenav.ts → ds-portfolio-doublenav.ts} +4 -5
  13. package/DS1/3-unit/ds-portfolio-panel.ts +25 -0
  14. package/DS1/3-unit/list-v1.ts +24 -0
  15. package/DS1/3-unit/{ds-panel.ts → panel-v1.ts} +2 -3
  16. package/DS1/3-unit/row-v1.ts +52 -0
  17. package/DS1/3-unit/{ds-singlenav.ts → singlenav-v1.ts} +4 -5
  18. package/DS1/4-page/ds-grid.ts +1 -1
  19. package/DS1/index.ts +39 -37
  20. package/dist/0-face/{2025-04-23-device.d.ts → device.d.ts} +1 -1
  21. package/dist/0-face/device.d.ts.map +1 -0
  22. package/dist/{utils/language.d.ts → 0-face/i18n.d.ts} +1 -1
  23. package/dist/0-face/i18n.d.ts.map +1 -0
  24. package/dist/{utils/language.js → 0-face/i18n.js} +141 -2
  25. package/dist/0-face/preferences.d.ts +9 -0
  26. package/dist/0-face/preferences.d.ts.map +1 -0
  27. package/dist/0-face/preferences.js +14 -0
  28. package/dist/0-face/pricing.d.ts +15 -0
  29. package/dist/0-face/pricing.d.ts.map +1 -0
  30. package/dist/0-face/pricing.js +46 -0
  31. package/dist/0-face/theme.d.ts.map +1 -0
  32. package/dist/2-core/ds-button.js +1 -1
  33. package/dist/2-core/ds-cycle.js +15 -15
  34. package/dist/2-core/{ds-year.d.ts → ds-date.d.ts} +4 -4
  35. package/dist/2-core/ds-date.d.ts.map +1 -0
  36. package/dist/2-core/{ds-year.js → ds-date.js} +4 -4
  37. package/dist/2-core/ds-input.d.ts +1 -0
  38. package/dist/2-core/ds-input.d.ts.map +1 -0
  39. package/dist/2-core/ds-input.js +1 -0
  40. package/dist/2-core/ds-text.js +1 -1
  41. package/dist/2-core/ds-tooltip.d.ts.map +1 -1
  42. package/dist/2-core/ds-tooltip.js +4 -2
  43. package/dist/3-unit/{ds-doublenav.d.ts → ds-portfolio-doublenav.d.ts} +4 -4
  44. package/dist/3-unit/ds-portfolio-doublenav.d.ts.map +1 -0
  45. package/dist/3-unit/{ds-doublenav.js → ds-portfolio-doublenav.js} +4 -4
  46. package/dist/3-unit/{ds-panel.d.ts → ds-portfolio-panel.d.ts} +3 -3
  47. package/dist/3-unit/ds-portfolio-panel.d.ts.map +1 -0
  48. package/dist/3-unit/{ds-panel.js → ds-portfolio-panel.js} +3 -3
  49. package/dist/3-unit/{ds-singlenav.d.ts → ds-portfolio-singlenav.d.ts} +4 -4
  50. package/dist/3-unit/ds-portfolio-singlenav.d.ts.map +1 -0
  51. package/dist/3-unit/{ds-singlenav.js → ds-portfolio-singlenav.js} +4 -4
  52. package/dist/4-page/ds-grid.js +1 -1
  53. package/dist/ds-one.bundle.js +2075 -3774
  54. package/dist/ds-one.bundle.js.map +4 -4
  55. package/dist/ds-one.bundle.min.js +74 -740
  56. package/dist/ds-one.bundle.min.js.map +4 -4
  57. package/dist/index.d.ts +16 -26
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +32 -34
  60. package/package.json +2 -2
  61. package/DS1/0-face/2025-04-23-language.ts +0 -4
  62. package/DS1/2-core/ds-article.ts +0 -454
  63. package/DS1/2-core/ds-attributes.ts +0 -155
  64. package/DS1/2-core/ds-downloadcv.ts +0 -146
  65. package/DS1/2-core/ds-header.ts +0 -82
  66. package/DS1/2-core/ds-home.ts +0 -168
  67. package/DS1/2-core/ds-link.ts +0 -121
  68. package/DS1/2-core/ds-markdown.ts +0 -252
  69. package/DS1/2-core/ds-price.ts +0 -108
  70. package/DS1/2-core/ds-squarecircle.ts +0 -155
  71. package/DS1/2-core/ds-title.ts +0 -139
  72. package/DS1/2-core/ds-viewtoggle.ts +0 -83
  73. package/DS1/utils/cdn-loader.ts +0 -208
  74. package/DS1/utils/keys.json +0 -41
  75. package/DS1/utils/pricing.ts +0 -24
  76. package/DS1/utils/scroll.ts +0 -184
  77. package/DS1/utils/settings.ts +0 -23
  78. package/DS1/utils/viewMode.ts +0 -55
  79. package/dist/0-face/2025-04-23-device.d.ts.map +0 -1
  80. package/dist/0-face/2025-04-23-language.d.ts +0 -1
  81. package/dist/0-face/2025-04-23-language.d.ts.map +0 -1
  82. package/dist/0-face/2025-04-23-language.js +0 -3
  83. package/dist/2-core/article-v1.d.ts +0 -129
  84. package/dist/2-core/article-v1.d.ts.map +0 -1
  85. package/dist/2-core/article-v1.js +0 -361
  86. package/dist/2-core/attributes-v1.d.ts +0 -47
  87. package/dist/2-core/attributes-v1.d.ts.map +0 -1
  88. package/dist/2-core/attributes-v1.js +0 -128
  89. package/dist/2-core/cycle-v1.d.ts +0 -66
  90. package/dist/2-core/cycle-v1.d.ts.map +0 -1
  91. package/dist/2-core/cycle-v1.js +0 -586
  92. package/dist/2-core/downloadcv-v1.d.ts +0 -58
  93. package/dist/2-core/downloadcv-v1.d.ts.map +0 -1
  94. package/dist/2-core/downloadcv-v1.js +0 -119
  95. package/dist/2-core/ds-article.d.ts +0 -129
  96. package/dist/2-core/ds-article.d.ts.map +0 -1
  97. package/dist/2-core/ds-article.js +0 -361
  98. package/dist/2-core/ds-attributes.d.ts +0 -47
  99. package/dist/2-core/ds-attributes.d.ts.map +0 -1
  100. package/dist/2-core/ds-attributes.js +0 -128
  101. package/dist/2-core/ds-button.figma.d.ts +0 -2
  102. package/dist/2-core/ds-button.figma.d.ts.map +0 -1
  103. package/dist/2-core/ds-button.figma.js +0 -6
  104. package/dist/2-core/ds-downloadcv.d.ts +0 -58
  105. package/dist/2-core/ds-downloadcv.d.ts.map +0 -1
  106. package/dist/2-core/ds-downloadcv.js +0 -119
  107. package/dist/2-core/ds-header.d.ts +0 -28
  108. package/dist/2-core/ds-header.d.ts.map +0 -1
  109. package/dist/2-core/ds-header.js +0 -66
  110. package/dist/2-core/ds-home.d.ts +0 -26
  111. package/dist/2-core/ds-home.d.ts.map +0 -1
  112. package/dist/2-core/ds-home.js +0 -148
  113. package/dist/2-core/ds-link.d.ts +0 -35
  114. package/dist/2-core/ds-link.d.ts.map +0 -1
  115. package/dist/2-core/ds-link.js +0 -85
  116. package/dist/2-core/ds-markdown.d.ts +0 -7
  117. package/dist/2-core/ds-markdown.d.ts.map +0 -1
  118. package/dist/2-core/ds-markdown.js +0 -240
  119. package/dist/2-core/ds-price.d.ts +0 -46
  120. package/dist/2-core/ds-price.d.ts.map +0 -1
  121. package/dist/2-core/ds-price.js +0 -72
  122. package/dist/2-core/ds-squarecircle.d.ts +0 -50
  123. package/dist/2-core/ds-squarecircle.d.ts.map +0 -1
  124. package/dist/2-core/ds-squarecircle.js +0 -133
  125. package/dist/2-core/ds-title.d.ts +0 -50
  126. package/dist/2-core/ds-title.d.ts.map +0 -1
  127. package/dist/2-core/ds-title.js +0 -103
  128. package/dist/2-core/ds-viewtoggle.d.ts +0 -27
  129. package/dist/2-core/ds-viewtoggle.d.ts.map +0 -1
  130. package/dist/2-core/ds-viewtoggle.js +0 -49
  131. package/dist/2-core/ds-year.d.ts.map +0 -1
  132. package/dist/2-core/header-v1.d.ts +0 -28
  133. package/dist/2-core/header-v1.d.ts.map +0 -1
  134. package/dist/2-core/header-v1.js +0 -66
  135. package/dist/2-core/home-v1.d.ts +0 -26
  136. package/dist/2-core/home-v1.d.ts.map +0 -1
  137. package/dist/2-core/home-v1.js +0 -148
  138. package/dist/2-core/icon-v1.d.ts +0 -28
  139. package/dist/2-core/icon-v1.d.ts.map +0 -1
  140. package/dist/2-core/icon-v1.js +0 -297
  141. package/dist/2-core/link-v1.d.ts +0 -35
  142. package/dist/2-core/link-v1.d.ts.map +0 -1
  143. package/dist/2-core/link-v1.js +0 -85
  144. package/dist/2-core/markdown-v1.d.ts +0 -7
  145. package/dist/2-core/markdown-v1.d.ts.map +0 -1
  146. package/dist/2-core/markdown-v1.js +0 -240
  147. package/dist/2-core/price-v1.d.ts +0 -46
  148. package/dist/2-core/price-v1.d.ts.map +0 -1
  149. package/dist/2-core/price-v1.js +0 -72
  150. package/dist/2-core/squarecircle-v1.d.ts +0 -50
  151. package/dist/2-core/squarecircle-v1.d.ts.map +0 -1
  152. package/dist/2-core/squarecircle-v1.js +0 -133
  153. package/dist/2-core/text-v1.d.ts +0 -48
  154. package/dist/2-core/text-v1.d.ts.map +0 -1
  155. package/dist/2-core/text-v1.js +0 -83
  156. package/dist/2-core/title-v1.d.ts +0 -50
  157. package/dist/2-core/title-v1.d.ts.map +0 -1
  158. package/dist/2-core/title-v1.js +0 -103
  159. package/dist/2-core/tooltip-v1.d.ts +0 -39
  160. package/dist/2-core/tooltip-v1.d.ts.map +0 -1
  161. package/dist/2-core/tooltip-v1.js +0 -145
  162. package/dist/2-core/viewtoggle-v1.d.ts +0 -27
  163. package/dist/2-core/viewtoggle-v1.d.ts.map +0 -1
  164. package/dist/2-core/viewtoggle-v1.js +0 -49
  165. package/dist/2-core/year-v1.d.ts +0 -16
  166. package/dist/2-core/year-v1.d.ts.map +0 -1
  167. package/dist/2-core/year-v1.js +0 -21
  168. package/dist/3-unit/ds-doublenav.d.ts.map +0 -1
  169. package/dist/3-unit/ds-panel.d.ts.map +0 -1
  170. package/dist/3-unit/ds-singlenav.d.ts.map +0 -1
  171. package/dist/utils/cdn-loader.d.ts +0 -19
  172. package/dist/utils/cdn-loader.d.ts.map +0 -1
  173. package/dist/utils/cdn-loader.js +0 -142
  174. package/dist/utils/keys.json +0 -41
  175. package/dist/utils/language.d.ts.map +0 -1
  176. package/dist/utils/pricing.d.ts +0 -8
  177. package/dist/utils/pricing.d.ts.map +0 -1
  178. package/dist/utils/pricing.js +0 -14
  179. package/dist/utils/scroll.d.ts +0 -34
  180. package/dist/utils/scroll.d.ts.map +0 -1
  181. package/dist/utils/scroll.js +0 -140
  182. package/dist/utils/settings.d.ts +0 -9
  183. package/dist/utils/settings.d.ts.map +0 -1
  184. package/dist/utils/settings.js +0 -14
  185. package/dist/utils/theme.d.ts.map +0 -1
  186. package/dist/utils/viewMode.d.ts +0 -14
  187. package/dist/utils/viewMode.d.ts.map +0 -1
  188. package/dist/utils/viewMode.js +0 -46
  189. /package/DS1/0-face/{2025-04-23-device.ts → device.ts} +0 -0
  190. /package/DS1/{utils → 0-face}/theme.ts +0 -0
  191. /package/DS1/{x Icon → x-icon}/1x.svg +0 -0
  192. /package/DS1/{x Icon → x-icon}/1xdots.svg +0 -0
  193. /package/DS1/{x Icon → x-icon}/1xgrid.svg +0 -0
  194. /package/DS1/{x Icon → x-icon}/1xlines.svg +0 -0
  195. /package/DS1/{x Icon → x-icon}/2x.svg +0 -0
  196. /package/DS1/{x Icon → x-icon}/2xdots.svg +0 -0
  197. /package/DS1/{x Icon → x-icon}/2xgrid.svg +0 -0
  198. /package/DS1/{x Icon → x-icon}/2xlines.svg +0 -0
  199. /package/DS1/{x Icon → x-icon}/big.svg +0 -0
  200. /package/DS1/{x Icon → x-icon}/blank.svg +0 -0
  201. /package/DS1/{x Icon → x-icon}/check.svg +0 -0
  202. /package/DS1/{x Icon → x-icon}/close.svg +0 -0
  203. /package/DS1/{x Icon → x-icon}/collapse.svg +0 -0
  204. /package/DS1/{x Icon → x-icon}/color.svg +0 -0
  205. /package/DS1/{x Icon → x-icon}/column.svg +0 -0
  206. /package/DS1/{x Icon → x-icon}/default.svg +0 -0
  207. /package/DS1/{x Icon → x-icon}/delete.svg +0 -0
  208. /package/DS1/{x Icon → x-icon}/do.svg +0 -0
  209. /package/DS1/{x Icon → x-icon}/down.svg +0 -0
  210. /package/DS1/{x Icon → x-icon}/duplicate.svg +0 -0
  211. /package/DS1/{x Icon → x-icon}/email.svg +0 -0
  212. /package/DS1/{x Icon → x-icon}/expand.svg +0 -0
  213. /package/DS1/{x Icon → x-icon}/gallery.svg +0 -0
  214. /package/DS1/{x Icon → x-icon}/group.svg +0 -0
  215. /package/DS1/{x Icon → x-icon}/head.svg +0 -0
  216. /package/DS1/{x Icon → x-icon}/icon.svg +0 -0
  217. /package/DS1/{x Icon → x-icon}/left.svg +0 -0
  218. /package/DS1/{x Icon → x-icon}/lock.svg +0 -0
  219. /package/DS1/{x Icon → x-icon}/mic.svg +0 -0
  220. /package/DS1/{x Icon → x-icon}/minimize.svg +0 -0
  221. /package/DS1/{x Icon → x-icon}/more.svg +0 -0
  222. /package/DS1/{x Icon → x-icon}/note.svg +0 -0
  223. /package/DS1/{x Icon → x-icon}/open.svg +0 -0
  224. /package/DS1/{x Icon → x-icon}/page.svg +0 -0
  225. /package/DS1/{x Icon → x-icon}/plus.svg +0 -0
  226. /package/DS1/{x Icon → x-icon}/rewind.svg +0 -0
  227. /package/DS1/{x Icon → x-icon}/right.svg +0 -0
  228. /package/DS1/{x Icon → x-icon}/row..svg +0 -0
  229. /package/DS1/{x Icon → x-icon}/search.svg +0 -0
  230. /package/DS1/{x Icon → x-icon}/see.svg +0 -0
  231. /package/DS1/{x Icon → x-icon}/star.svg +0 -0
  232. /package/DS1/{x Icon → x-icon}/title.svg +0 -0
  233. /package/DS1/{x Icon → x-icon}/undo.svg +0 -0
  234. /package/DS1/{x Icon → x-icon}/ungroup.svg +0 -0
  235. /package/DS1/{x Icon → x-icon}/unhead.svg +0 -0
  236. /package/DS1/{x Icon → x-icon}/unicon.svg +0 -0
  237. /package/DS1/{x Icon → x-icon}/unlock.svg +0 -0
  238. /package/DS1/{x Icon → x-icon}/unmic.svg +0 -0
  239. /package/DS1/{x Icon → x-icon}/unsee.svg +0 -0
  240. /package/DS1/{x Icon → x-icon}/unstar.svg +0 -0
  241. /package/DS1/{x Icon → x-icon}/untitle.svg +0 -0
  242. /package/DS1/{x Icon → x-icon}/up.svg +0 -0
  243. /package/dist/0-face/{2025-04-23-device.js → device.js} +0 -0
  244. /package/dist/{utils → 0-face}/theme.d.ts +0 -0
  245. /package/dist/{utils → 0-face}/theme.js +0 -0
@@ -1,129 +0,0 @@
1
- import { LitElement } from "lit";
2
- /**
3
- * A component for displaying article content with image/text toggle
4
- *
5
- * @element article-v1
6
- */
7
- export declare class Article extends LitElement {
8
- static get properties(): {
9
- imgLightDesktop: {
10
- type: StringConstructor;
11
- reflect: boolean;
12
- attribute: string;
13
- };
14
- imgDarkDesktop: {
15
- type: StringConstructor;
16
- reflect: boolean;
17
- attribute: string;
18
- };
19
- imgLightMobile: {
20
- type: StringConstructor;
21
- reflect: boolean;
22
- attribute: string;
23
- };
24
- imgDarkMobile: {
25
- type: StringConstructor;
26
- reflect: boolean;
27
- attribute: string;
28
- };
29
- src: {
30
- type: StringConstructor;
31
- reflect: boolean;
32
- };
33
- alt: {
34
- type: StringConstructor;
35
- reflect: boolean;
36
- };
37
- imageToggle: {
38
- type: BooleanConstructor;
39
- reflect: boolean;
40
- attribute: string;
41
- };
42
- imageOnlyWidth: {
43
- type: NumberConstructor;
44
- reflect: boolean;
45
- attribute: string;
46
- };
47
- priority: {
48
- type: BooleanConstructor;
49
- reflect: boolean;
50
- };
51
- externalToggle: {
52
- type: BooleanConstructor;
53
- reflect: boolean;
54
- attribute: string;
55
- };
56
- mobileKey: {
57
- type: StringConstructor;
58
- reflect: boolean;
59
- attribute: string;
60
- };
61
- desktopKey: {
62
- type: StringConstructor;
63
- reflect: boolean;
64
- attribute: string;
65
- };
66
- textKey: {
67
- type: StringConstructor;
68
- reflect: boolean;
69
- attribute: string;
70
- };
71
- defaultValue: {
72
- type: StringConstructor;
73
- reflect: boolean;
74
- attribute: string;
75
- };
76
- _text: {
77
- type: StringConstructor;
78
- state: boolean;
79
- };
80
- _currentImage: {
81
- type: StringConstructor;
82
- state: boolean;
83
- };
84
- _imageVisible: {
85
- type: BooleanConstructor;
86
- state: boolean;
87
- };
88
- _shouldAnimate: {
89
- type: BooleanConstructor;
90
- state: boolean;
91
- };
92
- };
93
- imgLightDesktop: string;
94
- imgDarkDesktop: string;
95
- imgLightMobile: string;
96
- imgDarkMobile: string;
97
- src: string;
98
- alt: string;
99
- imageToggle: boolean;
100
- imageOnlyWidth: number;
101
- priority: boolean;
102
- externalToggle: boolean;
103
- mobileKey: string;
104
- desktopKey: string;
105
- textKey: string;
106
- defaultValue: string;
107
- _text: string;
108
- _currentImage: string;
109
- _imageVisible: boolean;
110
- _shouldAnimate: boolean;
111
- private _mql;
112
- private boundHandlers;
113
- constructor();
114
- static styles: import("lit").CSSResult;
115
- updated(changed: Map<string, unknown>): void;
116
- connectedCallback(): void;
117
- disconnectedCallback(): void;
118
- private _loadText;
119
- private _resolveImage;
120
- private _toggleImage;
121
- private _handleImageLoad;
122
- render(): import("lit-html").TemplateResult<1>;
123
- }
124
- declare global {
125
- interface HTMLElementTagNameMap {
126
- "article-v1": Article;
127
- }
128
- }
129
- //# sourceMappingURL=article-v1.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"article-v1.d.ts","sourceRoot":"","sources":["../../DS1/2-core/article-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;GAIG;AACH,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6CpB;IAEO,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IAEhC,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,aAAa,CAKnB;;IAiDF,MAAM,CAAC,MAAM,0BAmEX;IAEF,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAkCrC,iBAAiB;IAuDjB,oBAAoB;IA+BpB,OAAO,CAAC,SAAS;IAsCjB,OAAO,CAAC,aAAa;IAwCrB,OAAO,CAAC,YAAY,CAIlB;IAEF,OAAO,CAAC,gBAAgB,CAGtB;IAEF,MAAM;CAmCP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,OAAO,CAAC;KACvB;CACF"}
@@ -1,361 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- import { getText } from "../utils/language";
3
- import { getViewMode } from "../utils/viewMode";
4
- /**
5
- * A component for displaying article content with image/text toggle
6
- *
7
- * @element article-v1
8
- */
9
- export class Article extends LitElement {
10
- static get properties() {
11
- return {
12
- imgLightDesktop: {
13
- type: String,
14
- reflect: true,
15
- attribute: "img-light-desktop",
16
- },
17
- imgDarkDesktop: {
18
- type: String,
19
- reflect: true,
20
- attribute: "img-dark-desktop",
21
- },
22
- imgLightMobile: {
23
- type: String,
24
- reflect: true,
25
- attribute: "img-light-mobile",
26
- },
27
- imgDarkMobile: {
28
- type: String,
29
- reflect: true,
30
- attribute: "img-dark-mobile",
31
- },
32
- src: { type: String, reflect: true },
33
- alt: { type: String, reflect: true },
34
- imageToggle: { type: Boolean, reflect: true, attribute: "image-toggle" },
35
- imageOnlyWidth: {
36
- type: Number,
37
- reflect: true,
38
- attribute: "image-only-width",
39
- },
40
- priority: { type: Boolean, reflect: true },
41
- externalToggle: {
42
- type: Boolean,
43
- reflect: true,
44
- attribute: "external-toggle",
45
- },
46
- mobileKey: { type: String, reflect: true, attribute: "mobile-key" },
47
- desktopKey: { type: String, reflect: true, attribute: "desktop-key" },
48
- textKey: { type: String, reflect: true, attribute: "text-key" },
49
- defaultValue: { type: String, reflect: true, attribute: "default-value" },
50
- _text: { type: String, state: true },
51
- _currentImage: { type: String, state: true },
52
- _imageVisible: { type: Boolean, state: true },
53
- _shouldAnimate: { type: Boolean, state: true },
54
- };
55
- }
56
- constructor() {
57
- super();
58
- this._toggleImage = () => {
59
- this._shouldAnimate = true;
60
- this._imageVisible = !this._imageVisible;
61
- this.requestUpdate();
62
- };
63
- this._handleImageLoad = (e) => {
64
- const img = e.target;
65
- img.classList.add("loaded");
66
- };
67
- this.imgLightDesktop = "";
68
- this.imgDarkDesktop = "";
69
- this.imgLightMobile = "";
70
- this.imgDarkMobile = "";
71
- this.src = "";
72
- this.alt = "";
73
- this.imageToggle = false;
74
- this.imageOnlyWidth = 480;
75
- this.priority = false;
76
- this.externalToggle = false;
77
- this.mobileKey = "";
78
- this.desktopKey = "";
79
- this.textKey = "";
80
- this.defaultValue = "";
81
- this._text = "";
82
- this._currentImage = "";
83
- this._imageVisible = true;
84
- this._shouldAnimate = false;
85
- this._mql = null;
86
- this.boundHandlers = {
87
- languageChanged: (() => {
88
- this._loadText();
89
- }),
90
- themeChanged: (() => {
91
- this._resolveImage();
92
- }),
93
- viewportChanged: (e) => {
94
- this._resolveImage();
95
- this._loadText();
96
- },
97
- viewModeChanged: ((e) => {
98
- if (this.imageToggle && this.externalToggle) {
99
- const newMode = e.detail;
100
- const shouldShowImage = newMode === "image";
101
- if (this._imageVisible !== shouldShowImage) {
102
- this._shouldAnimate = true;
103
- this._imageVisible = shouldShowImage;
104
- this.requestUpdate();
105
- }
106
- }
107
- }),
108
- };
109
- }
110
- updated(changed) {
111
- if (changed.has("imageOnlyWidth")) {
112
- const opx = Number(this.imageOnlyWidth) || 480;
113
- this.style.setProperty("--image-only-width", `${opx}px`);
114
- }
115
- if (changed.has("imgLightDesktop") ||
116
- changed.has("imgDarkDesktop") ||
117
- changed.has("imgLightMobile") ||
118
- changed.has("imgDarkMobile") ||
119
- changed.has("src")) {
120
- this._resolveImage();
121
- }
122
- if (changed.has("textKey") ||
123
- changed.has("defaultValue") ||
124
- changed.has("mobileKey") ||
125
- changed.has("desktopKey")) {
126
- this._loadText();
127
- }
128
- if (changed.has("imageToggle")) {
129
- const isExternallyControlled = this.imageToggle && this.externalToggle;
130
- if (!isExternallyControlled) {
131
- const newImageVisible = !this.imageToggle;
132
- if (this._imageVisible !== newImageVisible) {
133
- this._shouldAnimate = true;
134
- this._imageVisible = newImageVisible;
135
- }
136
- }
137
- }
138
- }
139
- connectedCallback() {
140
- super.connectedCallback();
141
- this._loadText();
142
- this._resolveImage();
143
- if (this.imageToggle && this.externalToggle) {
144
- const currentMode = getViewMode();
145
- this._imageVisible = currentMode === "image";
146
- }
147
- else {
148
- this._imageVisible = !this.imageToggle;
149
- }
150
- this.style.setProperty("--image-only-width", `${this.imageOnlyWidth}px`);
151
- try {
152
- this._mql = window.matchMedia("(max-width: 720px)");
153
- if (this._mql && this.boundHandlers.viewportChanged) {
154
- this._mql.addEventListener("change", this.boundHandlers.viewportChanged);
155
- }
156
- }
157
- catch (err) {
158
- // no-op
159
- }
160
- window.addEventListener("language-changed", this.boundHandlers.languageChanged);
161
- window.addEventListener("theme-changed", this.boundHandlers.themeChanged);
162
- if (this.imageToggle && this.externalToggle) {
163
- window.addEventListener("view-mode-changed", this.boundHandlers.viewModeChanged);
164
- setTimeout(() => {
165
- const currentMode = getViewMode();
166
- const shouldShowImage = currentMode === "image";
167
- if (this._imageVisible !== shouldShowImage) {
168
- this._shouldAnimate = true;
169
- this._imageVisible = shouldShowImage;
170
- this.requestUpdate();
171
- }
172
- }, 100);
173
- }
174
- else if (this.imageToggle) {
175
- window.addEventListener("article-toggle", this._toggleImage);
176
- }
177
- }
178
- disconnectedCallback() {
179
- super.disconnectedCallback();
180
- window.removeEventListener("language-changed", this.boundHandlers.languageChanged);
181
- window.removeEventListener("theme-changed", this.boundHandlers.themeChanged);
182
- window.removeEventListener("article-toggle", this._toggleImage);
183
- window.removeEventListener("view-mode-changed", this.boundHandlers.viewModeChanged);
184
- if (this._mql && this.boundHandlers.viewportChanged) {
185
- try {
186
- this._mql.removeEventListener("change", this.boundHandlers.viewportChanged);
187
- }
188
- catch (err) {
189
- // no-op
190
- }
191
- }
192
- }
193
- _loadText() {
194
- const isMobile = (() => {
195
- try {
196
- return (window.matchMedia && window.matchMedia("(max-width: 720px)").matches);
197
- }
198
- catch (err) {
199
- return false;
200
- }
201
- })();
202
- const selectedKey = (() => {
203
- const mobile = (this.mobileKey || "").trim();
204
- const desktop = (this.desktopKey || "").trim();
205
- const base = (this.textKey || "").trim();
206
- if (mobile || desktop) {
207
- return isMobile ? mobile || base : desktop || base;
208
- }
209
- return base;
210
- })();
211
- if (!selectedKey) {
212
- this._text = this.defaultValue || "";
213
- return;
214
- }
215
- try {
216
- const text = getText(selectedKey);
217
- this._text = text || this.defaultValue || selectedKey;
218
- }
219
- catch (error) {
220
- console.error(`[article-v1] Error loading text for key "${selectedKey}":`, error);
221
- this._text = this.defaultValue || selectedKey;
222
- }
223
- }
224
- _resolveImage() {
225
- if (this.src && typeof this.src === "string") {
226
- const direct = this.src.startsWith("@") ? this.src.slice(1) : this.src;
227
- this._currentImage = direct;
228
- return;
229
- }
230
- const theme = document.documentElement.getAttribute("data-theme") || "light";
231
- const isMobile = (() => {
232
- try {
233
- return (window.matchMedia && window.matchMedia("(max-width: 720px)").matches);
234
- }
235
- catch (err) {
236
- return false;
237
- }
238
- })();
239
- let chosen = "";
240
- if (isMobile) {
241
- if (theme === "dark") {
242
- chosen = this.imgDarkMobile || this.imgLightMobile;
243
- }
244
- else {
245
- chosen = this.imgLightMobile || this.imgDarkMobile;
246
- }
247
- }
248
- else {
249
- if (theme === "dark") {
250
- chosen = this.imgDarkDesktop || this.imgLightDesktop;
251
- }
252
- else {
253
- chosen = this.imgLightDesktop || this.imgDarkDesktop;
254
- }
255
- }
256
- if (typeof chosen === "string" && chosen.startsWith("@")) {
257
- chosen = chosen.slice(1);
258
- }
259
- this._currentImage = chosen || "";
260
- }
261
- render() {
262
- const showImage = (this.imageToggle ? this._imageVisible : true) && !!this._currentImage;
263
- const animationClass = this._shouldAnimate ? "fade-in" : "";
264
- if (this._shouldAnimate) {
265
- this._shouldAnimate = false;
266
- }
267
- const buttonText = this._imageVisible
268
- ? getText("hideImage")
269
- : getText("viewImage");
270
- return html `
271
- <div class="container">
272
- ${this.imageToggle && !this.externalToggle
273
- ? html `<button @click="${this._toggleImage}" class="toggle-button">
274
- ${buttonText}
275
- </button>`
276
- : ""}
277
- ${showImage
278
- ? html `<figure class="media ${animationClass}">
279
- <img
280
- src="${this._currentImage}"
281
- alt="${this.alt || ""}"
282
- loading="${this.priority ? "eager" : "lazy"}"
283
- fetchpriority="${this.priority ? "high" : "auto"}"
284
- decoding="async"
285
- @load="${this._handleImageLoad}"
286
- />
287
- </figure>`
288
- : html `<p class="copy ${animationClass}">${this._text}</p>`}
289
- </div>
290
- `;
291
- }
292
- }
293
- Article.styles = css `
294
- :host {
295
- display: block;
296
- font-family: var(--typeface);
297
- overflow-wrap: break-word;
298
- word-wrap: break-word;
299
- word-break: break-word;
300
- hyphens: auto;
301
- color: light-dark(var(--black), var(--white));
302
- line-height: calc(20px * var(--scaling-factor));
303
- padding: calc(2px * var(--scaling-factor));
304
- }
305
-
306
- .container {
307
- position: relative;
308
- width: min(100%, var(--image-only-width));
309
- }
310
-
311
- figure.media,
312
- .copy {
313
- margin: 0;
314
- width: 100%;
315
- overflow: hidden;
316
- display: block;
317
- margin-bottom: calc(8px * var(--scaling-factor));
318
- }
319
-
320
- .fade-in {
321
- animation: fade-in 0.25s ease;
322
- }
323
-
324
- @keyframes fade-in {
325
- from {
326
- opacity: 0;
327
- }
328
- to {
329
- opacity: 1;
330
- }
331
- }
332
-
333
- img {
334
- display: block;
335
- width: 100%;
336
- height: auto;
337
- opacity: 0;
338
- transition: opacity 0.2s ease-in-out;
339
- }
340
-
341
- img.loaded {
342
- opacity: 1;
343
- }
344
-
345
- .toggle-button {
346
- background: none;
347
- border: none;
348
- color: inherit;
349
- cursor: pointer;
350
- font-family: var(--typeface);
351
- font-size: calc(14px * var(--scaling-factor));
352
- margin-bottom: calc(8px * var(--scaling-factor));
353
- padding: 0;
354
- text-decoration: underline;
355
- }
356
-
357
- .toggle-button:hover {
358
- opacity: 0.7;
359
- }
360
- `;
361
- customElements.define("article-v1", Article);
@@ -1,47 +0,0 @@
1
- import { LitElement } from "lit";
2
- /**
3
- * A component for displaying project/work attributes (year, category, status)
4
- *
5
- * @element attributes-v1
6
- * @prop {string} year - Year key for translation
7
- * @prop {string} category - Category key for translation
8
- * @prop {string} status - Status key for translation
9
- * @prop {string} type - Type of attributes: "project" or "work"
10
- */
11
- export declare class Attributes extends LitElement {
12
- static get properties(): {
13
- year: {
14
- type: StringConstructor;
15
- reflect: boolean;
16
- };
17
- category: {
18
- type: StringConstructor;
19
- reflect: boolean;
20
- };
21
- status: {
22
- type: StringConstructor;
23
- reflect: boolean;
24
- };
25
- type: {
26
- type: StringConstructor;
27
- reflect: boolean;
28
- };
29
- };
30
- year: string;
31
- category: string;
32
- status: string;
33
- type: string;
34
- private boundHandlers;
35
- static styles: import("lit").CSSResult;
36
- constructor();
37
- connectedCallback(): void;
38
- disconnectedCallback(): void;
39
- _getStatusClass(status: string): string;
40
- render(): import("lit-html").TemplateResult<1>;
41
- }
42
- declare global {
43
- interface HTMLElementTagNameMap {
44
- "attributes-v1": Attributes;
45
- }
46
- }
47
- //# sourceMappingURL=attributes-v1.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributes-v1.d.ts","sourceRoot":"","sources":["../../DS1/2-core/attributes-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;MAOpB;IAEO,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IAErB,OAAO,CAAC,aAAa,CAAqC;IAE1D,MAAM,CAAC,MAAM,0BA2CX;;IAgBF,iBAAiB;IAQjB,oBAAoB;IAQpB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAQvC,MAAM;CAiCP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,UAAU,CAAC;KAC7B;CACF"}
@@ -1,128 +0,0 @@
1
- import { LitElement, html, css } from "lit";
2
- import { getText } from "../utils/language";
3
- /**
4
- * A component for displaying project/work attributes (year, category, status)
5
- *
6
- * @element attributes-v1
7
- * @prop {string} year - Year key for translation
8
- * @prop {string} category - Category key for translation
9
- * @prop {string} status - Status key for translation
10
- * @prop {string} type - Type of attributes: "project" or "work"
11
- */
12
- export class Attributes extends LitElement {
13
- static get properties() {
14
- return {
15
- year: { type: String, reflect: true },
16
- category: { type: String, reflect: true },
17
- status: { type: String, reflect: true },
18
- type: { type: String, reflect: true },
19
- };
20
- }
21
- constructor() {
22
- super();
23
- this.year = "";
24
- this.category = "";
25
- this.status = "";
26
- this.type = "project";
27
- this.boundHandlers = {
28
- languageChanged: (() => {
29
- this.requestUpdate();
30
- }),
31
- };
32
- }
33
- connectedCallback() {
34
- super.connectedCallback();
35
- window.addEventListener("language-changed", this.boundHandlers.languageChanged);
36
- }
37
- disconnectedCallback() {
38
- super.disconnectedCallback();
39
- window.removeEventListener("language-changed", this.boundHandlers.languageChanged);
40
- }
41
- _getStatusClass(status) {
42
- if (status.includes("Done"))
43
- return "done";
44
- if (status.includes("Ongoing"))
45
- return "ongoing";
46
- if (status.includes("Pending"))
47
- return "pending";
48
- if (status.includes("NotStarted"))
49
- return "not-started";
50
- return "pending";
51
- }
52
- render() {
53
- return html `
54
- ${this.year
55
- ? html `
56
- <div class="attribute-row">${getText(this.year) || this.year}</div>
57
- `
58
- : ""}
59
- ${this.category
60
- ? html `
61
- <div class="attribute-row">
62
- ${this.type === "work"
63
- ? html `<span
64
- class="status-indicator ${this._getStatusClass(this.status)}"
65
- ></span>`
66
- : ""}
67
- ${getText(this.category) || this.category}
68
- </div>
69
- `
70
- : ""}
71
- ${this.status && this.type === "project"
72
- ? html `
73
- <div class="attribute-row">
74
- <span
75
- class="status-indicator ${this._getStatusClass(this.status)}"
76
- ></span>
77
- ${getText(this.status) || this.status}
78
- </div>
79
- `
80
- : ""}
81
- `;
82
- }
83
- }
84
- Attributes.styles = css `
85
- :host {
86
- display: flex;
87
- flex-direction: row;
88
- gap: calc(16px * var(--scaling-factor));
89
- align-items: flex-start;
90
- }
91
-
92
- .attribute-row {
93
- display: inline-flex;
94
- height: calc(20px * var(--scaling-factor));
95
- padding: 0px calc(2px * var(--scaling-factor));
96
- align-items: flex-start;
97
- gap: calc(5px * var(--scaling-factor));
98
- font-family: var(--typeface);
99
- font-size: calc(14px * var(--scaling-factor));
100
- color: light-dark(var(--slate), var(--slate-dark));
101
- }
102
-
103
- .status-indicator {
104
- width: calc(8px * var(--scaling-factor));
105
- height: calc(8px * var(--scaling-factor));
106
- display: inline-block;
107
- transition:
108
- background 0.2s,
109
- border-radius 0.2s;
110
- }
111
-
112
- .status-indicator.done {
113
- background-color: green;
114
- }
115
-
116
- .status-indicator.ongoing {
117
- background-color: #30adec;
118
- }
119
-
120
- .status-indicator.pending {
121
- background-color: #f6c71c;
122
- }
123
-
124
- .status-indicator.not-started {
125
- background-color: #b1b4b9;
126
- }
127
- `;
128
- customElements.define("attributes-v1", Attributes);