ds-one 0.2.0-alpha.1 → 0.2.0-alpha.3
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/DS1/1-root/one.css +1 -1
- package/DS1/2-core/{article-v1.ts → ds-article.ts} +5 -4
- package/DS1/2-core/{attributes-v1.ts → ds-attributes.ts} +4 -3
- package/DS1/2-core/{cycle-v1.ts → ds-cycle.ts} +11 -10
- package/DS1/2-core/{downloadcv-v1.ts → ds-downloadcv.ts} +9 -8
- package/DS1/2-core/{header-v1.ts → ds-header.ts} +4 -3
- package/DS1/2-core/{home-v1.ts → ds-home.ts} +3 -2
- package/DS1/2-core/{icon-v1.ts → ds-icon.ts} +2 -2
- package/DS1/2-core/{link-v1.ts → ds-link.ts} +5 -5
- package/DS1/2-core/{markdown-v1.ts → ds-markdown.ts} +3 -2
- package/DS1/2-core/{price-v1.ts → ds-price.ts} +4 -3
- package/DS1/2-core/{squarecircle-v1.ts → ds-squarecircle.ts} +4 -3
- package/DS1/2-core/{title-v1.ts → ds-title.ts} +5 -4
- package/DS1/2-core/{tooltip-v1.ts → ds-tooltip.ts} +4 -3
- package/DS1/2-core/{viewtoggle-v1.ts → ds-viewtoggle.ts} +4 -3
- package/DS1/2-core/{year-v1.ts → ds-year.ts} +4 -3
- package/DS1/3-unit/{doublenav-v1.ts → ds-doublenav.ts} +9 -8
- package/DS1/3-unit/{list-v1.ts → ds-list.ts} +3 -2
- package/DS1/3-unit/{panel-v1.ts → ds-panel.ts} +3 -2
- package/DS1/3-unit/{row-v1.ts → ds-row.ts} +3 -2
- package/DS1/3-unit/{singlenav-v1.ts → ds-singlenav.ts} +5 -4
- package/DS1/index.ts +20 -20
- package/DS1/utils/cdn-loader.ts +20 -44
- package/README.md +4 -4
- package/dist/2-core/ds-article.d.ts +129 -0
- package/dist/2-core/ds-article.d.ts.map +1 -0
- package/dist/2-core/ds-article.js +361 -0
- package/dist/2-core/ds-attributes.d.ts +47 -0
- package/dist/2-core/ds-attributes.d.ts.map +1 -0
- package/dist/2-core/ds-attributes.js +128 -0
- package/dist/2-core/ds-cycle.d.ts +66 -0
- package/dist/2-core/ds-cycle.d.ts.map +1 -0
- package/dist/2-core/ds-cycle.js +586 -0
- package/dist/2-core/ds-downloadcv.d.ts +58 -0
- package/dist/2-core/ds-downloadcv.d.ts.map +1 -0
- package/dist/2-core/ds-downloadcv.js +119 -0
- package/dist/2-core/ds-header.d.ts +28 -0
- package/dist/2-core/ds-header.d.ts.map +1 -0
- package/dist/2-core/ds-header.js +66 -0
- package/dist/2-core/ds-home.d.ts +26 -0
- package/dist/2-core/ds-home.d.ts.map +1 -0
- package/dist/2-core/ds-home.js +148 -0
- package/dist/2-core/ds-icon.d.ts +28 -0
- package/dist/2-core/ds-icon.d.ts.map +1 -0
- package/dist/2-core/ds-icon.js +297 -0
- package/dist/2-core/ds-link.d.ts +35 -0
- package/dist/2-core/ds-link.d.ts.map +1 -0
- package/dist/2-core/ds-link.js +85 -0
- package/dist/2-core/ds-markdown.d.ts +7 -0
- package/dist/2-core/ds-markdown.d.ts.map +1 -0
- package/dist/2-core/ds-markdown.js +240 -0
- package/dist/2-core/ds-price.d.ts +46 -0
- package/dist/2-core/ds-price.d.ts.map +1 -0
- package/dist/2-core/ds-price.js +72 -0
- package/dist/2-core/ds-squarecircle.d.ts +50 -0
- package/dist/2-core/ds-squarecircle.d.ts.map +1 -0
- package/dist/2-core/ds-squarecircle.js +133 -0
- package/dist/2-core/ds-title.d.ts +50 -0
- package/dist/2-core/ds-title.d.ts.map +1 -0
- package/dist/2-core/ds-title.js +103 -0
- package/dist/2-core/ds-tooltip.d.ts +39 -0
- package/dist/2-core/ds-tooltip.d.ts.map +1 -0
- package/dist/2-core/ds-tooltip.js +145 -0
- package/dist/2-core/ds-viewtoggle.d.ts +27 -0
- package/dist/2-core/ds-viewtoggle.d.ts.map +1 -0
- package/dist/2-core/ds-viewtoggle.js +49 -0
- package/dist/2-core/ds-year.d.ts +16 -0
- package/dist/2-core/ds-year.d.ts.map +1 -0
- package/dist/2-core/ds-year.js +21 -0
- package/dist/3-unit/ds-doublenav.d.ts +51 -0
- package/dist/3-unit/ds-doublenav.d.ts.map +1 -0
- package/dist/3-unit/ds-doublenav.js +88 -0
- package/dist/3-unit/ds-list.d.ts +11 -0
- package/dist/3-unit/ds-list.d.ts.map +1 -0
- package/dist/3-unit/ds-list.js +15 -0
- package/dist/3-unit/ds-panel.d.ts +11 -0
- package/dist/3-unit/ds-panel.d.ts.map +1 -0
- package/dist/3-unit/ds-panel.js +16 -0
- package/dist/3-unit/ds-row.d.ts +25 -0
- package/dist/3-unit/ds-row.d.ts.map +1 -0
- package/dist/3-unit/ds-row.js +32 -0
- package/dist/3-unit/ds-singlenav.d.ts +32 -0
- package/dist/3-unit/ds-singlenav.d.ts.map +1 -0
- package/dist/3-unit/ds-singlenav.js +62 -0
- package/dist/ds-one.bundle.js +79 -99
- package/dist/ds-one.bundle.js.map +3 -3
- package/dist/ds-one.bundle.min.js +47 -47
- package/dist/ds-one.bundle.min.js.map +4 -4
- package/dist/index.d.ts +20 -20
- package/dist/index.js +20 -20
- package/dist/utils/cdn-loader.d.ts.map +1 -1
- package/dist/utils/cdn-loader.js +20 -38
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,26 +2,26 @@ import "./0-face/2025-04-23-device";
|
|
|
2
2
|
import "./utils/cdn-loader";
|
|
3
3
|
export * from "./2-core/ds-button";
|
|
4
4
|
export * from "./2-core/ds-text";
|
|
5
|
-
export * from "./2-core/icon
|
|
6
|
-
export * from "./2-core/link
|
|
7
|
-
export * from "./2-core/cycle
|
|
8
|
-
export * from "./2-core/tooltip
|
|
9
|
-
export * from "./2-core/price
|
|
10
|
-
export * from "./2-core/markdown
|
|
11
|
-
export * from "./2-core/home
|
|
12
|
-
export * from "./2-core/year
|
|
13
|
-
export * from "./2-core/title
|
|
14
|
-
export * from "./2-core/header
|
|
15
|
-
export * from "./2-core/attributes
|
|
16
|
-
export * from "./2-core/downloadcv
|
|
17
|
-
export * from "./2-core/article
|
|
18
|
-
export * from "./2-core/viewtoggle
|
|
19
|
-
export * from "./2-core/squarecircle
|
|
20
|
-
export * from "./3-unit/list
|
|
21
|
-
export * from "./3-unit/panel
|
|
22
|
-
export * from "./3-unit/row
|
|
23
|
-
export * from "./3-unit/singlenav
|
|
24
|
-
export * from "./3-unit/doublenav
|
|
5
|
+
export * from "./2-core/ds-icon";
|
|
6
|
+
export * from "./2-core/ds-link";
|
|
7
|
+
export * from "./2-core/ds-cycle";
|
|
8
|
+
export * from "./2-core/ds-tooltip";
|
|
9
|
+
export * from "./2-core/ds-price";
|
|
10
|
+
export * from "./2-core/ds-markdown";
|
|
11
|
+
export * from "./2-core/ds-home";
|
|
12
|
+
export * from "./2-core/ds-year";
|
|
13
|
+
export * from "./2-core/ds-title";
|
|
14
|
+
export * from "./2-core/ds-header";
|
|
15
|
+
export * from "./2-core/ds-attributes";
|
|
16
|
+
export * from "./2-core/ds-downloadcv";
|
|
17
|
+
export * from "./2-core/ds-article";
|
|
18
|
+
export * from "./2-core/ds-viewtoggle";
|
|
19
|
+
export * from "./2-core/ds-squarecircle";
|
|
20
|
+
export * from "./3-unit/ds-list";
|
|
21
|
+
export * from "./3-unit/ds-panel";
|
|
22
|
+
export * from "./3-unit/ds-row";
|
|
23
|
+
export * from "./3-unit/ds-singlenav";
|
|
24
|
+
export * from "./3-unit/ds-doublenav";
|
|
25
25
|
export * from "./3-unit/ds-table";
|
|
26
26
|
export * from "./4-page/ds-grid";
|
|
27
27
|
export * from "./4-page/ds-layout";
|
package/dist/index.js
CHANGED
|
@@ -7,27 +7,27 @@ import "./utils/cdn-loader";
|
|
|
7
7
|
// Core components
|
|
8
8
|
export * from "./2-core/ds-button";
|
|
9
9
|
export * from "./2-core/ds-text";
|
|
10
|
-
export * from "./2-core/icon
|
|
11
|
-
export * from "./2-core/link
|
|
12
|
-
export * from "./2-core/cycle
|
|
13
|
-
export * from "./2-core/tooltip
|
|
14
|
-
export * from "./2-core/price
|
|
15
|
-
export * from "./2-core/markdown
|
|
16
|
-
export * from "./2-core/home
|
|
17
|
-
export * from "./2-core/year
|
|
18
|
-
export * from "./2-core/title
|
|
19
|
-
export * from "./2-core/header
|
|
20
|
-
export * from "./2-core/attributes
|
|
21
|
-
export * from "./2-core/downloadcv
|
|
22
|
-
export * from "./2-core/article
|
|
23
|
-
export * from "./2-core/viewtoggle
|
|
24
|
-
export * from "./2-core/squarecircle
|
|
10
|
+
export * from "./2-core/ds-icon";
|
|
11
|
+
export * from "./2-core/ds-link";
|
|
12
|
+
export * from "./2-core/ds-cycle";
|
|
13
|
+
export * from "./2-core/ds-tooltip";
|
|
14
|
+
export * from "./2-core/ds-price";
|
|
15
|
+
export * from "./2-core/ds-markdown";
|
|
16
|
+
export * from "./2-core/ds-home";
|
|
17
|
+
export * from "./2-core/ds-year";
|
|
18
|
+
export * from "./2-core/ds-title";
|
|
19
|
+
export * from "./2-core/ds-header";
|
|
20
|
+
export * from "./2-core/ds-attributes";
|
|
21
|
+
export * from "./2-core/ds-downloadcv";
|
|
22
|
+
export * from "./2-core/ds-article";
|
|
23
|
+
export * from "./2-core/ds-viewtoggle";
|
|
24
|
+
export * from "./2-core/ds-squarecircle";
|
|
25
25
|
// Unit components
|
|
26
|
-
export * from "./3-unit/list
|
|
27
|
-
export * from "./3-unit/panel
|
|
28
|
-
export * from "./3-unit/row
|
|
29
|
-
export * from "./3-unit/singlenav
|
|
30
|
-
export * from "./3-unit/doublenav
|
|
26
|
+
export * from "./3-unit/ds-list";
|
|
27
|
+
export * from "./3-unit/ds-panel";
|
|
28
|
+
export * from "./3-unit/ds-row";
|
|
29
|
+
export * from "./3-unit/ds-singlenav";
|
|
30
|
+
export * from "./3-unit/ds-doublenav";
|
|
31
31
|
export * from "./3-unit/ds-table";
|
|
32
32
|
// Page components
|
|
33
33
|
export * from "./4-page/ds-grid";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdn-loader.d.ts","sourceRoot":"","sources":["../../DS1/utils/cdn-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9C,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEtD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,mBAAmB,CAAC,EAAE,cAAc,CAAC;QACrC,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC;CACF;
|
|
1
|
+
{"version":3,"file":"cdn-loader.d.ts","sourceRoot":"","sources":["../../DS1/utils/cdn-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9C,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEtD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,mBAAmB,CAAC,EAAE,cAAc,CAAC;QACrC,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC;CACF;AAmID;;GAEG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC,CA8CjE"}
|
package/dist/utils/cdn-loader.js
CHANGED
|
@@ -5,20 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
// Track if we've already attempted to load
|
|
7
7
|
let loadAttempted = false;
|
|
8
|
-
const
|
|
9
|
-
"./keys.json",
|
|
10
|
-
"./tekst.json",
|
|
11
|
-
"./tekster.json",
|
|
12
|
-
"./language.json",
|
|
13
|
-
"./languages.json",
|
|
14
|
-
"./translations.json",
|
|
15
|
-
"./translate.json",
|
|
16
|
-
"./i18n.json",
|
|
17
|
-
"./locales.json",
|
|
18
|
-
"./strings.json",
|
|
19
|
-
"./text.json",
|
|
20
|
-
"./texts.json",
|
|
21
|
-
];
|
|
8
|
+
const DEFAULT_TRANSLATION_FILE = "./translations.json";
|
|
22
9
|
function normalizeCandidate(path) {
|
|
23
10
|
if (!path) {
|
|
24
11
|
return null;
|
|
@@ -59,20 +46,23 @@ function findAttributeCandidate() {
|
|
|
59
46
|
return null;
|
|
60
47
|
}
|
|
61
48
|
function resolveTranslationSources() {
|
|
62
|
-
const candidates =
|
|
49
|
+
const candidates = [];
|
|
63
50
|
const windowCandidate = typeof window !== "undefined" ? window.DS_ONE_TRANSLATIONS_FILE : null;
|
|
64
51
|
const attributeCandidate = findAttributeCandidate();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
// Only use explicitly configured paths, or the single default
|
|
53
|
+
const windowNormalized = normalizeCandidate(windowCandidate ?? "");
|
|
54
|
+
if (windowNormalized) {
|
|
55
|
+
candidates.push(windowNormalized);
|
|
56
|
+
}
|
|
57
|
+
const attrNormalized = normalizeCandidate(attributeCandidate ?? "");
|
|
58
|
+
if (attrNormalized && !candidates.includes(attrNormalized)) {
|
|
59
|
+
candidates.push(attrNormalized);
|
|
60
|
+
}
|
|
61
|
+
// Only try default if no explicit path was configured
|
|
62
|
+
if (candidates.length === 0) {
|
|
63
|
+
candidates.push(DEFAULT_TRANSLATION_FILE);
|
|
64
|
+
}
|
|
65
|
+
return candidates;
|
|
76
66
|
}
|
|
77
67
|
function validateTranslationMap(candidate) {
|
|
78
68
|
if (!candidate || typeof candidate !== "object") {
|
|
@@ -82,14 +72,12 @@ function validateTranslationMap(candidate) {
|
|
|
82
72
|
}
|
|
83
73
|
async function fetchTranslationFile(source) {
|
|
84
74
|
try {
|
|
85
|
-
console.log(`[DS one] Attempting to fetch translations from: ${source}`);
|
|
86
75
|
const response = await fetch(source);
|
|
87
76
|
if (!response.ok) {
|
|
88
|
-
|
|
77
|
+
// 404 is expected if no translations file exists - don't log as error
|
|
89
78
|
return null;
|
|
90
79
|
}
|
|
91
80
|
const translations = await response.json();
|
|
92
|
-
console.log(`[DS one] Successfully fetched JSON from ${source}`);
|
|
93
81
|
if (!validateTranslationMap(translations)) {
|
|
94
82
|
console.warn(`[DS one] Invalid translation format in ${source}. Expected object with language codes as keys.`);
|
|
95
83
|
return null;
|
|
@@ -99,16 +87,10 @@ async function fetchTranslationFile(source) {
|
|
|
99
87
|
console.warn(`[DS one] No languages found in ${source}`);
|
|
100
88
|
return null;
|
|
101
89
|
}
|
|
102
|
-
console.log(`[DS one] Valid translations found: ${languages.join(", ")}`);
|
|
103
90
|
return translations;
|
|
104
91
|
}
|
|
105
|
-
catch
|
|
106
|
-
|
|
107
|
-
error.message.includes("Failed to fetch")) {
|
|
108
|
-
console.log(`[DS one] Network error fetching ${source}`);
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
console.error(`[DS one] Error loading external translations from ${source}:`, error);
|
|
92
|
+
catch {
|
|
93
|
+
// Silently fail - file likely doesn't exist or isn't valid JSON
|
|
112
94
|
return null;
|
|
113
95
|
}
|
|
114
96
|
}
|
|
@@ -142,7 +124,7 @@ export async function loadExternalTranslations() {
|
|
|
142
124
|
window.dispatchEvent(new CustomEvent("translations-ready"));
|
|
143
125
|
return true;
|
|
144
126
|
}
|
|
145
|
-
console.info(`[DS one] No external translations found
|
|
127
|
+
console.info(`[DS one] No external translations found at ${sources[0] ?? DEFAULT_TRANSLATION_FILE}. Using bundled translations.`);
|
|
146
128
|
return false;
|
|
147
129
|
}
|
|
148
130
|
// Auto-load translations when this module is imported (for CDN bundle)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ds-one",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0-alpha.3",
|
|
4
|
+
"description": "A component-based design system built with TypeScript and LitElement that provides reusable UI components with built-in theming, internationalization, and accessibility features.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|