yumiamd 0.1.21 → 0.1.22
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/bin.js +1 -1
- package/dist/{chunk-TJR6MU2I.js → chunk-KNQTEIHN.js} +205 -79
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/dist/bin.js
CHANGED
|
@@ -2333,36 +2333,36 @@ var terminalTheme = {
|
|
|
2333
2333
|
},
|
|
2334
2334
|
radius: {
|
|
2335
2335
|
none: 0,
|
|
2336
|
-
sm:
|
|
2337
|
-
md:
|
|
2338
|
-
lg:
|
|
2339
|
-
xl:
|
|
2340
|
-
full:
|
|
2341
|
-
default:
|
|
2336
|
+
sm: 4,
|
|
2337
|
+
md: 8,
|
|
2338
|
+
lg: 12,
|
|
2339
|
+
xl: 16,
|
|
2340
|
+
full: 9999,
|
|
2341
|
+
default: 10
|
|
2342
2342
|
},
|
|
2343
2343
|
shadows: {
|
|
2344
2344
|
none: "none",
|
|
2345
|
-
sm: "
|
|
2346
|
-
md: "
|
|
2347
|
-
lg: "
|
|
2348
|
-
glow: "0 0
|
|
2345
|
+
sm: "0 2px 4px rgba(0, 0, 0, 0.3)",
|
|
2346
|
+
md: "0 4px 12px rgba(0, 0, 0, 0.4)",
|
|
2347
|
+
lg: "0 10px 24px rgba(0, 0, 0, 0.5)",
|
|
2348
|
+
glow: "0 0 16px rgba(0, 255, 102, 0.35)"
|
|
2349
2349
|
},
|
|
2350
2350
|
components: {
|
|
2351
2351
|
card: {
|
|
2352
|
-
background: "#
|
|
2353
|
-
borderColor: "
|
|
2354
|
-
borderRadius:
|
|
2352
|
+
background: "#111711",
|
|
2353
|
+
borderColor: "rgba(0, 255, 102, 0.35)",
|
|
2354
|
+
borderRadius: 12,
|
|
2355
2355
|
padding: 24
|
|
2356
2356
|
},
|
|
2357
2357
|
metric: {
|
|
2358
2358
|
valueColor: "#00FF66",
|
|
2359
2359
|
labelColor: "#4E7A4E",
|
|
2360
|
-
borderRadius:
|
|
2360
|
+
borderRadius: 12
|
|
2361
2361
|
},
|
|
2362
2362
|
code: {
|
|
2363
|
-
background: "#
|
|
2363
|
+
background: "#080C08",
|
|
2364
2364
|
textColor: "#00FF66",
|
|
2365
|
-
borderRadius:
|
|
2365
|
+
borderRadius: 8
|
|
2366
2366
|
},
|
|
2367
2367
|
table: {
|
|
2368
2368
|
headerBackground: "#1F331F",
|
|
@@ -4754,6 +4754,8 @@ var HtmlRenderer = class {
|
|
|
4754
4754
|
const aspectRatio = presentation.metadata.aspectRatio || "16:9";
|
|
4755
4755
|
const is43 = aspectRatio === "4:3";
|
|
4756
4756
|
const ratioAspect = is43 ? "4 / 3" : "16 / 9";
|
|
4757
|
+
const ratioW = is43 ? 4 : 16;
|
|
4758
|
+
const ratioH = is43 ? 3 : 9;
|
|
4757
4759
|
const options = context.options || {};
|
|
4758
4760
|
const liveReloadScript = options.liveReload ? `
|
|
4759
4761
|
<!-- YumiaMD Live Reload -->
|
|
@@ -4869,6 +4871,8 @@ var HtmlRenderer = class {
|
|
|
4869
4871
|
--yumia-radius-card: ${theme.components?.card?.borderRadius ?? theme.radius.default}px;
|
|
4870
4872
|
--yumia-shadow-glow: ${theme.shadows?.glow || "none"};
|
|
4871
4873
|
--yumia-ratio: ${ratioAspect};
|
|
4874
|
+
--yumia-ratio-w: ${ratioW};
|
|
4875
|
+
--yumia-ratio-h: ${ratioH};
|
|
4872
4876
|
}
|
|
4873
4877
|
|
|
4874
4878
|
* {
|
|
@@ -4890,19 +4894,34 @@ var HtmlRenderer = class {
|
|
|
4890
4894
|
user-select: none;
|
|
4891
4895
|
}
|
|
4892
4896
|
|
|
4897
|
+
#deck-container {
|
|
4898
|
+
position: relative;
|
|
4899
|
+
width: 100vw;
|
|
4900
|
+
height: 100vh;
|
|
4901
|
+
display: flex;
|
|
4902
|
+
align-items: center;
|
|
4903
|
+
justify-content: center;
|
|
4904
|
+
overflow: hidden;
|
|
4905
|
+
background: #050508;
|
|
4906
|
+
}
|
|
4907
|
+
|
|
4893
4908
|
#yumia-deck {
|
|
4894
4909
|
position: relative;
|
|
4895
4910
|
width: 100%;
|
|
4896
4911
|
height: 100%;
|
|
4912
|
+
max-width: calc(100vh * var(--yumia-ratio-w) / var(--yumia-ratio-h));
|
|
4913
|
+
max-height: calc(100vw * var(--yumia-ratio-h) / var(--yumia-ratio-w));
|
|
4914
|
+
aspect-ratio: var(--yumia-ratio);
|
|
4897
4915
|
display: flex;
|
|
4898
4916
|
align-items: center;
|
|
4899
4917
|
justify-content: center;
|
|
4900
4918
|
}
|
|
4901
4919
|
|
|
4902
4920
|
.yumia-slide-wrapper {
|
|
4903
|
-
position:
|
|
4904
|
-
|
|
4905
|
-
|
|
4921
|
+
position: absolute;
|
|
4922
|
+
inset: 0;
|
|
4923
|
+
width: 100%;
|
|
4924
|
+
height: 100%;
|
|
4906
4925
|
aspect-ratio: var(--yumia-ratio);
|
|
4907
4926
|
background-color: var(--yumia-bg);
|
|
4908
4927
|
border-radius: var(--yumia-radius-default);
|
|
@@ -4910,7 +4929,10 @@ var HtmlRenderer = class {
|
|
|
4910
4929
|
overflow: hidden;
|
|
4911
4930
|
display: none;
|
|
4912
4931
|
flex-direction: column;
|
|
4913
|
-
|
|
4932
|
+
justify-content: flex-start;
|
|
4933
|
+
align-items: stretch;
|
|
4934
|
+
padding: clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4.5rem);
|
|
4935
|
+
box-sizing: border-box;
|
|
4914
4936
|
animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
|
4915
4937
|
}
|
|
4916
4938
|
|
|
@@ -4928,38 +4950,40 @@ var HtmlRenderer = class {
|
|
|
4928
4950
|
font-family: var(--yumia-font-heading), system-ui, -apple-system, sans-serif;
|
|
4929
4951
|
font-weight: 700;
|
|
4930
4952
|
line-height: var(--yumia-line-height-tight);
|
|
4931
|
-
margin-bottom: 0.
|
|
4953
|
+
margin-bottom: 0.4em;
|
|
4932
4954
|
letter-spacing: var(--yumia-letter-spacing-tight);
|
|
4933
4955
|
overflow-wrap: break-word;
|
|
4934
4956
|
word-break: break-word;
|
|
4935
4957
|
}
|
|
4936
4958
|
|
|
4937
4959
|
h1 {
|
|
4938
|
-
font-size: clamp(
|
|
4960
|
+
font-size: clamp(1.8rem, 3.2vw, 2.9rem);
|
|
4939
4961
|
color: var(--yumia-primary);
|
|
4962
|
+
line-height: 1.15;
|
|
4940
4963
|
}
|
|
4941
4964
|
|
|
4942
4965
|
h2 {
|
|
4943
|
-
font-size: clamp(1.
|
|
4966
|
+
font-size: clamp(1.5rem, 2.6vw, 2.3rem);
|
|
4944
4967
|
color: var(--yumia-text);
|
|
4968
|
+
line-height: 1.2;
|
|
4945
4969
|
}
|
|
4946
4970
|
|
|
4947
4971
|
h3 {
|
|
4948
|
-
font-size: clamp(1.
|
|
4972
|
+
font-size: clamp(1.25rem, 2vw, 1.8rem);
|
|
4949
4973
|
color: var(--yumia-text);
|
|
4950
4974
|
}
|
|
4951
4975
|
|
|
4952
4976
|
h4 {
|
|
4953
|
-
font-size: clamp(1.
|
|
4977
|
+
font-size: clamp(1.05rem, 1.5vw, 1.35rem);
|
|
4954
4978
|
color: var(--yumia-muted);
|
|
4955
4979
|
}
|
|
4956
4980
|
|
|
4957
4981
|
/* Paragraphs */
|
|
4958
4982
|
p {
|
|
4959
|
-
font-size: clamp(
|
|
4983
|
+
font-size: clamp(0.95rem, 1.35vw, 1.2rem);
|
|
4960
4984
|
line-height: var(--yumia-line-height-normal);
|
|
4961
4985
|
color: var(--yumia-text);
|
|
4962
|
-
margin-bottom: 0.
|
|
4986
|
+
margin-bottom: 0.6em;
|
|
4963
4987
|
overflow-wrap: break-word;
|
|
4964
4988
|
}
|
|
4965
4989
|
|
|
@@ -4984,14 +5008,14 @@ var HtmlRenderer = class {
|
|
|
4984
5008
|
|
|
4985
5009
|
/* Lists */
|
|
4986
5010
|
ul, ol {
|
|
4987
|
-
font-size: clamp(
|
|
4988
|
-
line-height: 1.
|
|
4989
|
-
margin-bottom:
|
|
5011
|
+
font-size: clamp(0.95rem, 1.3vw, 1.15rem);
|
|
5012
|
+
line-height: 1.6;
|
|
5013
|
+
margin-bottom: 0.8em;
|
|
4990
5014
|
padding-left: 1.5em;
|
|
4991
5015
|
}
|
|
4992
5016
|
|
|
4993
5017
|
li {
|
|
4994
|
-
margin-bottom: 0.
|
|
5018
|
+
margin-bottom: 0.4em;
|
|
4995
5019
|
color: var(--yumia-text);
|
|
4996
5020
|
}
|
|
4997
5021
|
|
|
@@ -4999,12 +5023,41 @@ var HtmlRenderer = class {
|
|
|
4999
5023
|
color: var(--yumia-primary);
|
|
5000
5024
|
}
|
|
5001
5025
|
|
|
5026
|
+
/* Grid & Stack Layout Containers */
|
|
5027
|
+
.yumia-grid {
|
|
5028
|
+
display: grid;
|
|
5029
|
+
width: 100%;
|
|
5030
|
+
flex: 1;
|
|
5031
|
+
min-height: 0;
|
|
5032
|
+
gap: clamp(1rem, 1.8vw, 1.6rem);
|
|
5033
|
+
align-items: stretch;
|
|
5034
|
+
margin-top: 0.4rem;
|
|
5035
|
+
}
|
|
5036
|
+
|
|
5037
|
+
.yumia-stack {
|
|
5038
|
+
display: flex;
|
|
5039
|
+
width: 100%;
|
|
5040
|
+
flex: 1;
|
|
5041
|
+
min-height: 0;
|
|
5042
|
+
gap: clamp(1rem, 1.8vw, 1.6rem);
|
|
5043
|
+
align-items: stretch;
|
|
5044
|
+
margin-top: 0.4rem;
|
|
5045
|
+
}
|
|
5046
|
+
|
|
5047
|
+
.yumia-stack.stack-horizontal > * {
|
|
5048
|
+
flex: 1 1 0px;
|
|
5049
|
+
min-width: 0;
|
|
5050
|
+
height: 100%;
|
|
5051
|
+
}
|
|
5052
|
+
|
|
5002
5053
|
/* Columns */
|
|
5003
5054
|
.yumia-columns {
|
|
5004
5055
|
display: grid;
|
|
5005
|
-
gap: 1.
|
|
5056
|
+
gap: clamp(1rem, 1.8vw, 1.6rem);
|
|
5006
5057
|
width: 100%;
|
|
5007
|
-
|
|
5058
|
+
flex: 1;
|
|
5059
|
+
min-height: 0;
|
|
5060
|
+
margin: 0.4rem 0;
|
|
5008
5061
|
align-items: stretch;
|
|
5009
5062
|
}
|
|
5010
5063
|
|
|
@@ -5012,18 +5065,29 @@ var HtmlRenderer = class {
|
|
|
5012
5065
|
display: flex;
|
|
5013
5066
|
flex-direction: column;
|
|
5014
5067
|
gap: 0.8rem;
|
|
5068
|
+
height: 100%;
|
|
5015
5069
|
}
|
|
5016
5070
|
|
|
5017
5071
|
/* Cards */
|
|
5018
5072
|
.yumia-card {
|
|
5019
5073
|
background: var(--yumia-surface);
|
|
5020
5074
|
border: 1.5px solid var(--yumia-border);
|
|
5021
|
-
border-radius:
|
|
5022
|
-
padding: 1.
|
|
5075
|
+
border-radius: 14px;
|
|
5076
|
+
padding: clamp(1.2rem, 2vw, 1.8rem);
|
|
5023
5077
|
display: flex;
|
|
5024
5078
|
flex-direction: column;
|
|
5025
|
-
|
|
5026
|
-
|
|
5079
|
+
justify-content: flex-start;
|
|
5080
|
+
gap: 0.7rem;
|
|
5081
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
|
5082
|
+
height: 100%;
|
|
5083
|
+
min-height: 0;
|
|
5084
|
+
box-sizing: border-box;
|
|
5085
|
+
transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
|
|
5086
|
+
}
|
|
5087
|
+
|
|
5088
|
+
.yumia-card:hover {
|
|
5089
|
+
transform: translateY(-2px);
|
|
5090
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
5027
5091
|
}
|
|
5028
5092
|
|
|
5029
5093
|
.yumia-card[data-variant="primary"] {
|
|
@@ -5047,6 +5111,13 @@ var HtmlRenderer = class {
|
|
|
5047
5111
|
color: var(--yumia-success);
|
|
5048
5112
|
}
|
|
5049
5113
|
|
|
5114
|
+
.yumia-card[data-variant="accent"] {
|
|
5115
|
+
border-color: var(--yumia-accent);
|
|
5116
|
+
}
|
|
5117
|
+
.yumia-card[data-variant="accent"] .yumia-card-title {
|
|
5118
|
+
color: var(--yumia-accent);
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5050
5121
|
.yumia-card[data-variant="info"] {
|
|
5051
5122
|
border-color: var(--yumia-info);
|
|
5052
5123
|
}
|
|
@@ -5056,30 +5127,41 @@ var HtmlRenderer = class {
|
|
|
5056
5127
|
|
|
5057
5128
|
.yumia-card-title {
|
|
5058
5129
|
font-family: var(--yumia-font-heading);
|
|
5059
|
-
font-size: 1.
|
|
5130
|
+
font-size: clamp(1.1rem, 1.6vw, 1.35rem);
|
|
5060
5131
|
font-weight: 700;
|
|
5061
5132
|
color: var(--yumia-primary);
|
|
5062
|
-
margin-bottom: 0.
|
|
5133
|
+
margin-bottom: 0.2rem;
|
|
5063
5134
|
}
|
|
5064
5135
|
|
|
5065
5136
|
/* Metrics */
|
|
5066
5137
|
.yumia-metric {
|
|
5067
5138
|
background: var(--yumia-surface);
|
|
5068
5139
|
border: 1.5px solid var(--yumia-border);
|
|
5069
|
-
border-radius:
|
|
5070
|
-
padding: 1rem 1.
|
|
5140
|
+
border-radius: 14px;
|
|
5141
|
+
padding: clamp(1.4rem, 2.5vw, 2.4rem) clamp(1rem, 2vw, 1.8rem);
|
|
5071
5142
|
display: flex;
|
|
5072
5143
|
flex-direction: column;
|
|
5073
5144
|
align-items: center;
|
|
5074
5145
|
justify-content: center;
|
|
5075
5146
|
text-align: center;
|
|
5076
|
-
gap: 0.
|
|
5147
|
+
gap: 0.5rem;
|
|
5148
|
+
height: 100%;
|
|
5149
|
+
min-height: 150px;
|
|
5150
|
+
box-sizing: border-box;
|
|
5151
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
|
5152
|
+
transition: transform 0.2s ease, border-color 0.2s ease;
|
|
5153
|
+
}
|
|
5154
|
+
|
|
5155
|
+
.yumia-metric:hover {
|
|
5156
|
+
transform: translateY(-2px);
|
|
5077
5157
|
}
|
|
5078
5158
|
|
|
5079
5159
|
.yumia-metric[data-variant="primary"] { border-color: var(--yumia-primary); }
|
|
5080
5160
|
.yumia-metric[data-variant="primary"] .yumia-metric-value { color: var(--yumia-primary); }
|
|
5081
5161
|
.yumia-metric[data-variant="success"] { border-color: var(--yumia-success); }
|
|
5082
5162
|
.yumia-metric[data-variant="success"] .yumia-metric-value { color: var(--yumia-success); }
|
|
5163
|
+
.yumia-metric[data-variant="accent"] { border-color: var(--yumia-accent); }
|
|
5164
|
+
.yumia-metric[data-variant="accent"] .yumia-metric-value { color: var(--yumia-accent); }
|
|
5083
5165
|
.yumia-metric[data-variant="info"] { border-color: var(--yumia-info); }
|
|
5084
5166
|
.yumia-metric[data-variant="info"] .yumia-metric-value { color: var(--yumia-info); }
|
|
5085
5167
|
.yumia-metric[data-variant="warning"] { border-color: var(--yumia-warning); }
|
|
@@ -5088,28 +5170,55 @@ var HtmlRenderer = class {
|
|
|
5088
5170
|
.yumia-metric[data-variant="danger"] .yumia-metric-value { color: var(--yumia-danger); }
|
|
5089
5171
|
|
|
5090
5172
|
.yumia-metric-label {
|
|
5091
|
-
font-size: 0.
|
|
5173
|
+
font-size: clamp(0.72rem, 1vw, 0.9rem);
|
|
5092
5174
|
font-weight: 700;
|
|
5093
5175
|
text-transform: uppercase;
|
|
5094
|
-
letter-spacing: 0.
|
|
5176
|
+
letter-spacing: 0.1em;
|
|
5095
5177
|
color: var(--yumia-muted);
|
|
5096
5178
|
}
|
|
5097
5179
|
|
|
5098
5180
|
.yumia-metric-value {
|
|
5099
5181
|
font-family: var(--yumia-font-heading);
|
|
5100
|
-
font-size: clamp(
|
|
5182
|
+
font-size: clamp(2.3rem, 4.2vw, 3.8rem);
|
|
5101
5183
|
font-weight: 800;
|
|
5102
|
-
line-height: 1.
|
|
5184
|
+
line-height: 1.05;
|
|
5103
5185
|
color: var(--yumia-primary);
|
|
5104
5186
|
}
|
|
5105
5187
|
|
|
5106
5188
|
.yumia-metric-change {
|
|
5107
|
-
font-size: 0.
|
|
5189
|
+
font-size: clamp(0.8rem, 1.1vw, 1rem);
|
|
5108
5190
|
font-weight: 600;
|
|
5191
|
+
padding: 4px 12px;
|
|
5192
|
+
border-radius: 9999px;
|
|
5193
|
+
background: rgba(255, 255, 255, 0.08);
|
|
5109
5194
|
}
|
|
5110
5195
|
.yumia-metric-change.positive { color: var(--yumia-success); }
|
|
5111
5196
|
.yumia-metric-change.negative { color: var(--yumia-danger); }
|
|
5112
5197
|
|
|
5198
|
+
/* Chart Containers */
|
|
5199
|
+
.yumia-chart-container {
|
|
5200
|
+
width: 100%;
|
|
5201
|
+
flex: 1;
|
|
5202
|
+
min-height: 220px;
|
|
5203
|
+
display: flex;
|
|
5204
|
+
flex-direction: column;
|
|
5205
|
+
justify-content: center;
|
|
5206
|
+
background: var(--yumia-surface);
|
|
5207
|
+
border: 1.5px solid var(--yumia-border);
|
|
5208
|
+
border-radius: 14px;
|
|
5209
|
+
padding: clamp(1rem, 2vw, 1.6rem);
|
|
5210
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
|
5211
|
+
}
|
|
5212
|
+
|
|
5213
|
+
.yumia-chart-title {
|
|
5214
|
+
font-family: var(--yumia-font-heading);
|
|
5215
|
+
font-size: clamp(1.1rem, 1.5vw, 1.35rem);
|
|
5216
|
+
font-weight: 700;
|
|
5217
|
+
color: var(--yumia-primary);
|
|
5218
|
+
margin-bottom: 0.6rem;
|
|
5219
|
+
text-align: center;
|
|
5220
|
+
}
|
|
5221
|
+
|
|
5113
5222
|
/* Tables */
|
|
5114
5223
|
table {
|
|
5115
5224
|
width: 100%;
|
|
@@ -6477,24 +6586,25 @@ var HtmlRenderer = class {
|
|
|
6477
6586
|
}
|
|
6478
6587
|
case "icon": {
|
|
6479
6588
|
const ic = element;
|
|
6480
|
-
const iconSvg = defaultIconResolver.toSvg(ic.name, ic.size ||
|
|
6589
|
+
const iconSvg = defaultIconResolver.toSvg(ic.name, ic.size || 28, ic.color || "currentColor", "yumia-icon");
|
|
6481
6590
|
return `<span class="yumia-icon-wrapper" style="display:inline-flex; align-items:center; vertical-align:middle;">${iconSvg}</span>`;
|
|
6482
6591
|
}
|
|
6483
6592
|
case "grid": {
|
|
6484
6593
|
const g = element;
|
|
6485
|
-
const cols = typeof g.columns === "number" ? `repeat(${g.columns}, 1fr)` : g.columns;
|
|
6594
|
+
const cols = typeof g.columns === "number" ? `repeat(${g.columns}, minmax(0, 1fr))` : g.columns;
|
|
6486
6595
|
const gap = g.gap !== void 0 ? typeof g.gap === "number" ? `${g.gap}px` : g.gap : "1.5rem";
|
|
6487
6596
|
const inner = g.elements.map((child) => this.renderElement(child, theme, presentation)).join("\n");
|
|
6488
|
-
return `<div class="yumia-grid" style="
|
|
6597
|
+
return `<div class="yumia-grid" style="grid-template-columns:${cols}; gap:${gap};">${inner}</div>`;
|
|
6489
6598
|
}
|
|
6490
6599
|
case "stack": {
|
|
6491
6600
|
const st = element;
|
|
6492
|
-
const
|
|
6493
|
-
const
|
|
6601
|
+
const isHoriz = st.direction === "horizontal";
|
|
6602
|
+
const dir = isHoriz ? "row" : "column";
|
|
6603
|
+
const gap = st.gap !== void 0 ? typeof st.gap === "number" ? `${st.gap}px` : st.gap : "1.5rem";
|
|
6494
6604
|
const align = st.align ? `align-items:${st.align};` : "";
|
|
6495
6605
|
const justify = st.justify ? `justify-content:${st.justify};` : "";
|
|
6496
6606
|
const inner = st.elements.map((child) => this.renderElement(child, theme, presentation)).join("\n");
|
|
6497
|
-
return `<div class="yumia-stack" style="
|
|
6607
|
+
return `<div class="yumia-stack ${isHoriz ? "stack-horizontal" : "stack-vertical"}" style="flex-direction:${dir}; gap:${gap}; ${align} ${justify}">${inner}</div>`;
|
|
6498
6608
|
}
|
|
6499
6609
|
case "compare": {
|
|
6500
6610
|
return this.renderCompare(element, theme);
|
|
@@ -6554,11 +6664,18 @@ var HtmlRenderer = class {
|
|
|
6554
6664
|
if (c.chartType === "line") {
|
|
6555
6665
|
const allValues = series.flatMap((s) => s.values);
|
|
6556
6666
|
const maxVal2 = Math.max(...allValues, 1);
|
|
6557
|
-
const width2 =
|
|
6558
|
-
const height2 =
|
|
6559
|
-
const padding2 =
|
|
6667
|
+
const width2 = 640;
|
|
6668
|
+
const height2 = 240;
|
|
6669
|
+
const padding2 = 45;
|
|
6560
6670
|
const plotW2 = width2 - padding2 * 2;
|
|
6561
6671
|
const plotH2 = height2 - padding2 * 2;
|
|
6672
|
+
const gridLines2 = [0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6673
|
+
const y = height2 - padding2 - ratio * plotH2;
|
|
6674
|
+
const valLabel = Math.round(ratio * maxVal2);
|
|
6675
|
+
return `
|
|
6676
|
+
<line x1="${padding2}" y1="${y}" x2="${width2 - padding2}" y2="${y}" stroke="rgba(255,255,255,0.08)" stroke-dasharray="4 4" />
|
|
6677
|
+
<text x="${padding2 - 8}" y="${y + 4}" text-anchor="end" fill="${theme.colors.muted || "#64748b"}" font-size="10" font-family="sans-serif">${valLabel}</text>`;
|
|
6678
|
+
}).join("");
|
|
6562
6679
|
let pathsHtml = "";
|
|
6563
6680
|
series.forEach((s, sIdx) => {
|
|
6564
6681
|
const sColor = s.color || colors[sIdx % colors.length];
|
|
@@ -6568,20 +6685,21 @@ var HtmlRenderer = class {
|
|
|
6568
6685
|
return `${x},${y}`;
|
|
6569
6686
|
});
|
|
6570
6687
|
const pointsStr = pts.join(" ");
|
|
6571
|
-
const circles = pts.map((pt) => `<circle cx="${pt.split(",")[0]}" cy="${pt.split(",")[1]}" r="
|
|
6688
|
+
const circles = pts.map((pt) => `<circle cx="${pt.split(",")[0]}" cy="${pt.split(",")[1]}" r="5" fill="${sColor}" stroke="var(--yumia-surface)" stroke-width="2" />`).join("");
|
|
6572
6689
|
pathsHtml += `
|
|
6573
|
-
<polyline fill="none" stroke="${sColor}" stroke-width="3" stroke-linecap="round" points="${pointsStr}" />
|
|
6690
|
+
<polyline fill="none" stroke="${sColor}" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" points="${pointsStr}" />
|
|
6574
6691
|
${circles}`;
|
|
6575
6692
|
});
|
|
6576
6693
|
const labelTexts = labels.map((l, i) => {
|
|
6577
6694
|
const x = padding2 + i / Math.max(labels.length - 1, 1) * plotW2;
|
|
6578
|
-
return `<text x="${x}" y="${height2 -
|
|
6695
|
+
return `<text x="${x}" y="${height2 - 12}" text-anchor="middle" fill="${theme.colors.muted || "#94a3b8"}" font-size="11" font-weight="600" font-family="sans-serif">${this.escapeHtml(l)}</text>`;
|
|
6579
6696
|
}).join("");
|
|
6580
6697
|
return `
|
|
6581
6698
|
<div class="yumia-chart-container">
|
|
6582
6699
|
${titleHtml}
|
|
6583
|
-
<svg viewBox="0 0 ${width2} ${height2}" style="width:100%; max-height:
|
|
6584
|
-
|
|
6700
|
+
<svg viewBox="0 0 ${width2} ${height2}" style="width:100%; height:100%; max-height:280px;">
|
|
6701
|
+
${gridLines2}
|
|
6702
|
+
<line x1="${padding2}" y1="${height2 - padding2}" x2="${width2 - padding2}" y2="${height2 - padding2}" stroke="rgba(255,255,255,0.2)" stroke-width="1.5" />
|
|
6585
6703
|
${pathsHtml}
|
|
6586
6704
|
${labelTexts}
|
|
6587
6705
|
</svg>
|
|
@@ -6591,10 +6709,10 @@ var HtmlRenderer = class {
|
|
|
6591
6709
|
const values2 = series[0]?.values || [];
|
|
6592
6710
|
const total = values2.reduce((a, b) => a + b, 0) || 1;
|
|
6593
6711
|
let cumulativePercent = 0;
|
|
6594
|
-
const radius =
|
|
6595
|
-
const cx =
|
|
6596
|
-
const cy =
|
|
6597
|
-
const strokeWidth = c.chartType === "doughnut" ?
|
|
6712
|
+
const radius = 65;
|
|
6713
|
+
const cx = 110;
|
|
6714
|
+
const cy = 110;
|
|
6715
|
+
const strokeWidth = c.chartType === "doughnut" ? 26 : 65;
|
|
6598
6716
|
const circ = 2 * Math.PI * radius;
|
|
6599
6717
|
const slices = values2.map((val, i) => {
|
|
6600
6718
|
const percent = val / total;
|
|
@@ -6607,27 +6725,34 @@ var HtmlRenderer = class {
|
|
|
6607
6725
|
const legend = labels.map((l, i) => {
|
|
6608
6726
|
const sColor = colors[i % colors.length];
|
|
6609
6727
|
const pct = Math.round((values2[i] || 0) / total * 100);
|
|
6610
|
-
return `<div style="display:flex; align-items:center; gap:
|
|
6728
|
+
return `<div style="display:flex; align-items:center; gap:10px; font-size:13px; font-weight:600; margin:6px 0;"><span style="width:12px; height:12px; border-radius:50%; background:${sColor}; box-shadow:0 0 6px ${sColor};"></span><span style="color:var(--yumia-text);">${this.escapeHtml(l)} <strong style="color:var(--yumia-primary);">(${pct}%)</strong></span></div>`;
|
|
6611
6729
|
}).join("");
|
|
6612
6730
|
return `
|
|
6613
6731
|
<div class="yumia-chart-container">
|
|
6614
6732
|
${titleHtml}
|
|
6615
|
-
<div style="display:flex; align-items:center; justify-content:center; gap:
|
|
6616
|
-
<svg viewBox="0 0
|
|
6733
|
+
<div style="display:flex; align-items:center; justify-content:center; gap:36px; width:100%; padding:10px 0;">
|
|
6734
|
+
<svg viewBox="0 0 220 220" style="width:180px; height:180px; transform: rotate(-90deg);">
|
|
6617
6735
|
${slices}
|
|
6618
6736
|
</svg>
|
|
6619
|
-
<div style="display:flex; flex-direction:column;">${legend}</div>
|
|
6737
|
+
<div style="display:flex; flex-direction:column; justify-content:center;">${legend}</div>
|
|
6620
6738
|
</div>
|
|
6621
6739
|
</div>`;
|
|
6622
6740
|
}
|
|
6623
6741
|
const values = series[0]?.values || [];
|
|
6624
6742
|
const maxVal = Math.max(...values, 1);
|
|
6625
|
-
const width =
|
|
6626
|
-
const height =
|
|
6627
|
-
const padding =
|
|
6743
|
+
const width = 640;
|
|
6744
|
+
const height = 240;
|
|
6745
|
+
const padding = 45;
|
|
6628
6746
|
const plotW = width - padding * 2;
|
|
6629
6747
|
const plotH = height - padding * 2;
|
|
6630
|
-
const barWidth = Math.min(
|
|
6748
|
+
const barWidth = Math.min(56, Math.max(20, plotW / Math.max(values.length, 1) * 0.55));
|
|
6749
|
+
const gridLines = [0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
6750
|
+
const y = height - padding - ratio * plotH;
|
|
6751
|
+
const valLabel = Math.round(ratio * maxVal);
|
|
6752
|
+
return `
|
|
6753
|
+
<line x1="${padding}" y1="${y}" x2="${width - padding}" y2="${y}" stroke="rgba(255,255,255,0.08)" stroke-dasharray="4 4" />
|
|
6754
|
+
<text x="${padding - 8}" y="${y + 4}" text-anchor="end" fill="${theme.colors.muted || "#64748b"}" font-size="10" font-family="sans-serif">${valLabel}</text>`;
|
|
6755
|
+
}).join("");
|
|
6631
6756
|
const bars = values.map((val, i) => {
|
|
6632
6757
|
const x = padding + (i + 0.5) * (plotW / Math.max(values.length, 1)) - barWidth / 2;
|
|
6633
6758
|
const barH = val / maxVal * plotH;
|
|
@@ -6635,15 +6760,16 @@ var HtmlRenderer = class {
|
|
|
6635
6760
|
const color = colors[i % colors.length];
|
|
6636
6761
|
const label = labels[i] || "";
|
|
6637
6762
|
return `
|
|
6638
|
-
<rect x="${x}" y="${y}" width="${barWidth}" height="${barH}" rx="
|
|
6639
|
-
<text x="${x + barWidth / 2}" y="${y -
|
|
6640
|
-
<text x="${x + barWidth / 2}" y="${height - 12}" text-anchor="middle" fill="${theme.colors.
|
|
6763
|
+
<rect x="${x}" y="${y}" width="${barWidth}" height="${barH}" rx="6" fill="${color}" opacity="0.95" />
|
|
6764
|
+
<text x="${x + barWidth / 2}" y="${y - 8}" text-anchor="middle" fill="${color}" font-size="12" font-weight="700" font-family="sans-serif">${val}</text>
|
|
6765
|
+
<text x="${x + barWidth / 2}" y="${height - 12}" text-anchor="middle" fill="${theme.colors.text || "#f8fafc"}" font-size="11" font-weight="600" font-family="sans-serif">${this.escapeHtml(label)}</text>`;
|
|
6641
6766
|
}).join("");
|
|
6642
6767
|
return `
|
|
6643
6768
|
<div class="yumia-chart-container">
|
|
6644
6769
|
${titleHtml}
|
|
6645
|
-
<svg viewBox="0 0 ${width} ${height}" style="width:100%; max-height:
|
|
6646
|
-
|
|
6770
|
+
<svg viewBox="0 0 ${width} ${height}" style="width:100%; height:100%; max-height:280px;">
|
|
6771
|
+
${gridLines}
|
|
6772
|
+
<line x1="${padding}" y1="${height - padding}" x2="${width - padding}" y2="${height - padding}" stroke="rgba(255,255,255,0.2)" stroke-width="1.5" />
|
|
6647
6773
|
${bars}
|
|
6648
6774
|
</svg>
|
|
6649
6775
|
</div>`;
|
|
@@ -7295,7 +7421,7 @@ function startDevServer(filePath, options = {}) {
|
|
|
7295
7421
|
// src/cli.ts
|
|
7296
7422
|
import { mkdirSync, readFileSync as readFileSync2, watch as fsWatch, writeFileSync } from "fs";
|
|
7297
7423
|
import { basename, dirname, extname, join, resolve as resolve2 } from "path";
|
|
7298
|
-
var VERSION = "0.1.
|
|
7424
|
+
var VERSION = "0.1.22";
|
|
7299
7425
|
function printHelp() {
|
|
7300
7426
|
return `
|
|
7301
7427
|
YumiaMD \u2014 Markdown-based presentation compiler (v${VERSION})
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from '@yumiamd/renderer-pptx';
|
|
|
9
9
|
export * from '@yumiamd/renderer-html';
|
|
10
10
|
export * from '@yumiamd/renderer-pdf';
|
|
11
11
|
|
|
12
|
-
declare const VERSION = "0.1.
|
|
12
|
+
declare const VERSION = "0.1.22";
|
|
13
13
|
declare function printHelp(): string;
|
|
14
14
|
declare function runCli(argv: string[]): Promise<{
|
|
15
15
|
exitCode: number;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yumiamd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Command line interface and compiler for YumiaMD presentations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"tsup": "^8.5.1",
|
|
24
|
-
"@yumiamd/ast": "0.1.
|
|
25
|
-
"@yumiamd/layout": "0.1.
|
|
26
|
-
"@yumiamd/renderer": "0.1.
|
|
27
|
-
"@yumiamd/
|
|
28
|
-
"@yumiamd/
|
|
29
|
-
"@yumiamd/renderer-
|
|
30
|
-
"@yumiamd/
|
|
31
|
-
"@yumiamd/theme": "0.1.
|
|
32
|
-
"@yumiamd/
|
|
24
|
+
"@yumiamd/ast": "0.1.22",
|
|
25
|
+
"@yumiamd/layout": "0.1.22",
|
|
26
|
+
"@yumiamd/renderer-html": "0.1.22",
|
|
27
|
+
"@yumiamd/core": "0.1.22",
|
|
28
|
+
"@yumiamd/renderer": "0.1.22",
|
|
29
|
+
"@yumiamd/renderer-pdf": "0.1.22",
|
|
30
|
+
"@yumiamd/parser": "0.1.22",
|
|
31
|
+
"@yumiamd/theme": "0.1.22",
|
|
32
|
+
"@yumiamd/renderer-pptx": "0.1.22"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"yumia",
|