@bendyline/squisq 2.4.1 → 2.4.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/dist/{Doc-CSW6K2UF.d.ts → Doc-BKKcPjfe.d.ts} +1 -1
- package/dist/{ImageEditDoc-x9yoTb4l.d.ts → ImageEditDoc-CU1cXxRd.d.ts} +1 -1
- package/dist/{annotationCoercion-PtRQhk5V.d.ts → annotationCoercion-CPHEggo3.d.ts} +1 -1
- package/dist/chunk-24SENDJY.js +750 -0
- package/dist/doc/index.d.ts +10 -9
- package/dist/generate/index.d.ts +2 -2
- package/dist/imageEdit/index.d.ts +4 -4
- package/dist/index.d.ts +7 -7
- package/dist/index.js +6 -2
- package/dist/jsonForm/index.d.ts +2 -2
- package/dist/jsonForm/index.js +1 -1
- package/dist/markdown/index.d.ts +3 -3
- package/dist/{materializePageSection-_rrDuOYU.d.ts → materializePageSection-WDJCTJEm.d.ts} +2 -2
- package/dist/narration/index.d.ts +2 -2
- package/dist/recommend/index.d.ts +1 -1
- package/dist/schemas/index.d.ts +25 -6
- package/dist/schemas/index.js +6 -2
- package/dist/{themeLibrary-DlJzXsin.d.ts → themeLibrary-BMXXLZBU.d.ts} +1 -1
- package/dist/transform/index.d.ts +3 -3
- package/dist/{types-CUNc9biN.d.ts → types-CcrDFdWH.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-GODLNXO4.js +0 -360
package/dist/chunk-GODLNXO4.js
DELETED
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defaultPageStyle
|
|
3
|
-
} from "./chunk-GAZKTT4R.js";
|
|
4
|
-
import {
|
|
5
|
-
FONT_FALLBACKS,
|
|
6
|
-
THEME_SCHEMA_VERSION,
|
|
7
|
-
assertTheme,
|
|
8
|
-
createTheme,
|
|
9
|
-
deriveScale,
|
|
10
|
-
isHex,
|
|
11
|
-
oklchDarken,
|
|
12
|
-
oklchLighten,
|
|
13
|
-
oklchSetChroma,
|
|
14
|
-
pickContrastingText,
|
|
15
|
-
relativeLuminance,
|
|
16
|
-
resolveFontFamily,
|
|
17
|
-
withAlpha
|
|
18
|
-
} from "./chunk-SBAX4ZPO.js";
|
|
19
|
-
|
|
20
|
-
// src/schemas/Doc.ts
|
|
21
|
-
function calculateDuration(audio) {
|
|
22
|
-
return audio.segments.reduce((sum, seg) => sum + seg.duration, 0);
|
|
23
|
-
}
|
|
24
|
-
function getSegmentAtTime(audio, time) {
|
|
25
|
-
let elapsed = 0;
|
|
26
|
-
for (let i = 0; i < audio.segments.length; i++) {
|
|
27
|
-
elapsed += audio.segments[i].duration;
|
|
28
|
-
if (time < elapsed) return i;
|
|
29
|
-
}
|
|
30
|
-
return audio.segments.length - 1;
|
|
31
|
-
}
|
|
32
|
-
function getBlockAtTime(blocks, time) {
|
|
33
|
-
for (let i = blocks.length - 1; i >= 0; i--) {
|
|
34
|
-
const block = blocks[i];
|
|
35
|
-
if (time >= block.startTime && time < block.startTime + block.duration) {
|
|
36
|
-
return block;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return blocks[0] || null;
|
|
40
|
-
}
|
|
41
|
-
function getCaptionAtTime(captions, time) {
|
|
42
|
-
if (!captions || !captions.phrases.length) return null;
|
|
43
|
-
for (const phrase of captions.phrases) {
|
|
44
|
-
if (time >= phrase.startTime && time < phrase.endTime) {
|
|
45
|
-
return phrase;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/schemas/pipStyle.ts
|
|
52
|
-
var DEFAULT_SHADOW = "0 0.75em 2em rgba(0, 0, 0, 0.34)";
|
|
53
|
-
var DERIVED_BORDER_WIDTH = "max(1px, 0.12vw)";
|
|
54
|
-
function cssLength(value) {
|
|
55
|
-
return typeof value === "number" ? `${value}px` : value;
|
|
56
|
-
}
|
|
57
|
-
function resolveRadius(theme) {
|
|
58
|
-
const explicit = theme.style.pip?.cornerRadius;
|
|
59
|
-
if (explicit != null) {
|
|
60
|
-
if (typeof explicit === "number") return explicit <= 0 ? "0" : `${explicit}px`;
|
|
61
|
-
return explicit;
|
|
62
|
-
}
|
|
63
|
-
const br = theme.style.borderRadius ?? 0;
|
|
64
|
-
if (br <= 0) return "0";
|
|
65
|
-
return `${Math.min(28, Math.max(6, Math.round(br)))}%`;
|
|
66
|
-
}
|
|
67
|
-
function resolveBorder(theme) {
|
|
68
|
-
const border = theme.style.pip?.border;
|
|
69
|
-
if (border === "none") return "none";
|
|
70
|
-
if (border && typeof border === "object") {
|
|
71
|
-
const width = border.width == null ? DERIVED_BORDER_WIDTH : cssLength(border.width);
|
|
72
|
-
const color = border.color ?? withAlpha(theme.colors.text, 0.35);
|
|
73
|
-
return `${width} solid ${color}`;
|
|
74
|
-
}
|
|
75
|
-
return `${DERIVED_BORDER_WIDTH} solid ${withAlpha(theme.colors.text, 0.35)}`;
|
|
76
|
-
}
|
|
77
|
-
function resolveShadow(theme) {
|
|
78
|
-
const shadow = theme.style.pip?.shadow;
|
|
79
|
-
if (shadow === false || shadow === "none") return "none";
|
|
80
|
-
if (typeof shadow === "string") return shadow;
|
|
81
|
-
return DEFAULT_SHADOW;
|
|
82
|
-
}
|
|
83
|
-
function pipStyleVars(theme) {
|
|
84
|
-
return {
|
|
85
|
-
"--squisq-pip-radius": resolveRadius(theme),
|
|
86
|
-
"--squisq-pip-border": resolveBorder(theme),
|
|
87
|
-
"--squisq-pip-shadow": resolveShadow(theme)
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// src/schemas/themeCompile.ts
|
|
92
|
-
var STARTER_BODY_FONT = { stackId: "system-sans" };
|
|
93
|
-
var STARTER_TITLE_FONT = { stackId: "system-serif" };
|
|
94
|
-
var STARTER_MONO_FONT = { stackId: "system-mono" };
|
|
95
|
-
var STARTER_COLOR_SCHEMES = {
|
|
96
|
-
blue: { bg: "#1a365d", text: "#63b3ed", accent: "#90cdf4" },
|
|
97
|
-
green: { bg: "#22543d", text: "#9ae6b4", accent: "#68d391" },
|
|
98
|
-
purple: { bg: "#44337a", text: "#d6bcfa", accent: "#b794f4" },
|
|
99
|
-
red: { bg: "#742a2a", text: "#fc8181", accent: "#feb2b2" },
|
|
100
|
-
orange: { bg: "#744210", text: "#fbd38d", accent: "#f6ad55" },
|
|
101
|
-
teal: { bg: "#234e52", text: "#81e6d9", accent: "#4fd1c5" }
|
|
102
|
-
};
|
|
103
|
-
var STARTER_THEME = {
|
|
104
|
-
schemaVersion: THEME_SCHEMA_VERSION,
|
|
105
|
-
id: "custom",
|
|
106
|
-
name: "Custom Theme",
|
|
107
|
-
description: "Customizer starter \u2014 gets overridden by user choices.",
|
|
108
|
-
colors: {
|
|
109
|
-
primary: "#3182ce",
|
|
110
|
-
secondary: "#4a5568",
|
|
111
|
-
background: "#1a202c",
|
|
112
|
-
backgroundLight: "#2d3748",
|
|
113
|
-
text: "#f7fafc",
|
|
114
|
-
textMuted: "#a0aec0",
|
|
115
|
-
highlight: "#4299e1",
|
|
116
|
-
warning: "#fc8181"
|
|
117
|
-
},
|
|
118
|
-
typography: {
|
|
119
|
-
bodyFont: STARTER_BODY_FONT,
|
|
120
|
-
titleFont: STARTER_TITLE_FONT,
|
|
121
|
-
monoFont: STARTER_MONO_FONT,
|
|
122
|
-
titleWeight: "bold"
|
|
123
|
-
},
|
|
124
|
-
style: {
|
|
125
|
-
textShadow: true,
|
|
126
|
-
overlayOpacity: 0.45,
|
|
127
|
-
animationSpeed: 1,
|
|
128
|
-
borderRadius: 6
|
|
129
|
-
},
|
|
130
|
-
renderStyle: {
|
|
131
|
-
name: "standard",
|
|
132
|
-
defaultTextAnimation: "fadeIn",
|
|
133
|
-
defaultImageAnimation: "slowZoom",
|
|
134
|
-
ambientMotion: true,
|
|
135
|
-
defaultTransition: { type: "fade", duration: 0.7 }
|
|
136
|
-
},
|
|
137
|
-
colorSchemes: STARTER_COLOR_SCHEMES
|
|
138
|
-
};
|
|
139
|
-
function deriveColorPalette(seeds, partialColors = {}, opts = {}) {
|
|
140
|
-
const spread = opts.contrast === "high" ? 0.22 : opts.contrast === "subtle" ? 0.08 : 0.15;
|
|
141
|
-
const primary = seeds.primary;
|
|
142
|
-
const secondary = seeds.secondary ?? oklchSetChroma(oklchLighten(primary, 0.05), 0.5);
|
|
143
|
-
const accent = seeds.accent ?? oklchLighten(primary, spread);
|
|
144
|
-
const bgSeed = partialColors.background ?? seeds.background;
|
|
145
|
-
let background;
|
|
146
|
-
if (bgSeed) {
|
|
147
|
-
background = bgSeed;
|
|
148
|
-
} else {
|
|
149
|
-
background = relativeLuminance(primary) > 0.5 ? "#0a0a0a" : "#1a202c";
|
|
150
|
-
}
|
|
151
|
-
const isLightSurface = relativeLuminance(background) > 0.5;
|
|
152
|
-
const backgroundLight = partialColors.backgroundLight ?? (isLightSurface ? oklchDarken(background, 0.04) : oklchLighten(background, 0.04));
|
|
153
|
-
const text = partialColors.text ?? seeds.text ?? pickContrastingText(background, "#f7fafc", "#1a202c");
|
|
154
|
-
const textMuted = partialColors.textMuted ?? (isLightSurface ? oklchLighten(text, 0.25) : oklchDarken(text, 0.25));
|
|
155
|
-
const highlight = partialColors.highlight ?? accent;
|
|
156
|
-
const warning = partialColors.warning ?? "#fc8181";
|
|
157
|
-
return {
|
|
158
|
-
primary: partialColors.primary ?? primary,
|
|
159
|
-
secondary: partialColors.secondary ?? secondary,
|
|
160
|
-
background,
|
|
161
|
-
backgroundLight,
|
|
162
|
-
text,
|
|
163
|
-
textMuted,
|
|
164
|
-
highlight,
|
|
165
|
-
warning
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
function accentToColorScheme(accent) {
|
|
169
|
-
if (!isHex(accent)) return { bg: "#1a202c", text: "#e2e8f0", accent: "#63b3ed" };
|
|
170
|
-
const scale = deriveScale(accent, 0.3);
|
|
171
|
-
return { bg: scale.darker2, text: scale.lighter2, accent: scale.base };
|
|
172
|
-
}
|
|
173
|
-
function compileTheme(partial, opts = {}) {
|
|
174
|
-
const base = opts.base ?? STARTER_THEME;
|
|
175
|
-
const merged = createTheme(base, partial);
|
|
176
|
-
merged.schemaVersion = THEME_SCHEMA_VERSION;
|
|
177
|
-
if (opts.base && !merged.basedOn) merged.basedOn = opts.base.id;
|
|
178
|
-
const partialTypography = partial.typography;
|
|
179
|
-
if (partialTypography) {
|
|
180
|
-
if (partialTypography.titleFont !== void 0) {
|
|
181
|
-
merged.typography.titleFont = partialTypography.titleFont;
|
|
182
|
-
}
|
|
183
|
-
if (partialTypography.bodyFont !== void 0) {
|
|
184
|
-
merged.typography.bodyFont = partialTypography.bodyFont;
|
|
185
|
-
}
|
|
186
|
-
if (partialTypography.monoFont !== void 0) {
|
|
187
|
-
merged.typography.monoFont = partialTypography.monoFont;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (partial.colorSchemes !== void 0) {
|
|
191
|
-
merged.colorSchemes = partial.colorSchemes;
|
|
192
|
-
}
|
|
193
|
-
if (merged.seedColors) {
|
|
194
|
-
const partialColors = partial.colors ?? {};
|
|
195
|
-
merged.colors = deriveColorPalette(merged.seedColors, partialColors, {
|
|
196
|
-
contrast: opts.contrast
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
if (!merged.pageStyle) {
|
|
200
|
-
merged.pageStyle = defaultPageStyle(merged);
|
|
201
|
-
}
|
|
202
|
-
return assertTheme(merged, `compiled theme "${merged.id}"`);
|
|
203
|
-
}
|
|
204
|
-
function parseTheme(json) {
|
|
205
|
-
let parsed;
|
|
206
|
-
try {
|
|
207
|
-
parsed = JSON.parse(json);
|
|
208
|
-
} catch (err) {
|
|
209
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
210
|
-
throw new Error(`Invalid theme JSON: ${msg}`);
|
|
211
|
-
}
|
|
212
|
-
return assertTheme(parsed, "parsed theme");
|
|
213
|
-
}
|
|
214
|
-
function serializeTheme(theme) {
|
|
215
|
-
return JSON.stringify(theme, null, 2);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// src/schemas/mermaidTheme.ts
|
|
219
|
-
var MERMAID_CHART_COLOR_COUNT = 12;
|
|
220
|
-
function uniqueColors(colors) {
|
|
221
|
-
return colors.filter((color, index) => color && colors.indexOf(color) === index);
|
|
222
|
-
}
|
|
223
|
-
function chartPalette(theme) {
|
|
224
|
-
const schemes = Object.values(theme.colorSchemes);
|
|
225
|
-
const seeds = uniqueColors([
|
|
226
|
-
theme.colors.primary,
|
|
227
|
-
theme.colors.secondary,
|
|
228
|
-
theme.colors.highlight,
|
|
229
|
-
...schemes.map((scheme) => scheme.accent),
|
|
230
|
-
theme.colors.warning,
|
|
231
|
-
...schemes.map((scheme) => scheme.bg),
|
|
232
|
-
theme.colors.textMuted,
|
|
233
|
-
theme.colors.backgroundLight
|
|
234
|
-
]);
|
|
235
|
-
const fallback = theme.colors.primary;
|
|
236
|
-
return Array.from(
|
|
237
|
-
{ length: MERMAID_CHART_COLOR_COUNT },
|
|
238
|
-
(_, index) => seeds[index % Math.max(1, seeds.length)] ?? fallback
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
function textOn(theme, background) {
|
|
242
|
-
return pickContrastingText(background, theme.colors.text, theme.colors.background);
|
|
243
|
-
}
|
|
244
|
-
function buildMermaidThemeVariables(theme) {
|
|
245
|
-
const { colors } = theme;
|
|
246
|
-
const primaryText = textOn(theme, colors.primary);
|
|
247
|
-
const secondaryText = textOn(theme, colors.secondary);
|
|
248
|
-
const highlightText = textOn(theme, colors.highlight);
|
|
249
|
-
const palette = chartPalette(theme);
|
|
250
|
-
const variables = {
|
|
251
|
-
darkMode: relativeLuminance(colors.background) < 0.5,
|
|
252
|
-
background: colors.background,
|
|
253
|
-
fontFamily: resolveFontFamily(theme.typography.bodyFont, FONT_FALLBACKS.sans),
|
|
254
|
-
primaryColor: colors.primary,
|
|
255
|
-
primaryTextColor: primaryText,
|
|
256
|
-
primaryBorderColor: colors.highlight,
|
|
257
|
-
secondaryColor: colors.secondary,
|
|
258
|
-
secondaryTextColor: secondaryText,
|
|
259
|
-
secondaryBorderColor: colors.primary,
|
|
260
|
-
tertiaryColor: colors.backgroundLight,
|
|
261
|
-
tertiaryTextColor: colors.text,
|
|
262
|
-
tertiaryBorderColor: colors.textMuted,
|
|
263
|
-
textColor: colors.text,
|
|
264
|
-
titleColor: colors.text,
|
|
265
|
-
lineColor: colors.textMuted,
|
|
266
|
-
arrowheadColor: colors.textMuted,
|
|
267
|
-
defaultLinkColor: colors.textMuted,
|
|
268
|
-
mainBkg: colors.primary,
|
|
269
|
-
nodeBkg: colors.primary,
|
|
270
|
-
nodeTextColor: primaryText,
|
|
271
|
-
nodeBorder: colors.highlight,
|
|
272
|
-
clusterBkg: colors.backgroundLight,
|
|
273
|
-
clusterBorder: colors.secondary,
|
|
274
|
-
edgeLabelBackground: colors.background,
|
|
275
|
-
actorBkg: colors.backgroundLight,
|
|
276
|
-
actorBorder: colors.primary,
|
|
277
|
-
actorTextColor: colors.text,
|
|
278
|
-
actorLineColor: colors.textMuted,
|
|
279
|
-
signalColor: colors.textMuted,
|
|
280
|
-
signalTextColor: colors.text,
|
|
281
|
-
labelBoxBkgColor: colors.backgroundLight,
|
|
282
|
-
labelBoxBorderColor: colors.secondary,
|
|
283
|
-
labelTextColor: colors.text,
|
|
284
|
-
loopTextColor: colors.text,
|
|
285
|
-
activationBkgColor: colors.secondary,
|
|
286
|
-
activationBorderColor: colors.primary,
|
|
287
|
-
sequenceNumberColor: primaryText,
|
|
288
|
-
noteBkgColor: colors.highlight,
|
|
289
|
-
noteBorderColor: colors.primary,
|
|
290
|
-
noteTextColor: highlightText,
|
|
291
|
-
sectionBkgColor: colors.backgroundLight,
|
|
292
|
-
altSectionBkgColor: colors.background,
|
|
293
|
-
sectionBkgColor2: colors.primary,
|
|
294
|
-
taskBkgColor: colors.primary,
|
|
295
|
-
taskBorderColor: colors.highlight,
|
|
296
|
-
taskTextColor: primaryText,
|
|
297
|
-
taskTextLightColor: colors.text,
|
|
298
|
-
taskTextDarkColor: colors.text,
|
|
299
|
-
taskTextOutsideColor: colors.text,
|
|
300
|
-
taskTextClickableColor: colors.highlight,
|
|
301
|
-
activeTaskBkgColor: colors.secondary,
|
|
302
|
-
activeTaskBorderColor: colors.highlight,
|
|
303
|
-
doneTaskBkgColor: colors.backgroundLight,
|
|
304
|
-
doneTaskBorderColor: colors.textMuted,
|
|
305
|
-
critBkgColor: colors.warning,
|
|
306
|
-
critBorderColor: colors.highlight,
|
|
307
|
-
todayLineColor: colors.warning,
|
|
308
|
-
gridColor: colors.textMuted,
|
|
309
|
-
pieTitleTextColor: colors.text,
|
|
310
|
-
pieSectionTextColor: colors.text,
|
|
311
|
-
pieLegendTextColor: colors.text,
|
|
312
|
-
pieStrokeColor: colors.background,
|
|
313
|
-
pieOuterStrokeColor: colors.textMuted,
|
|
314
|
-
quadrantPointFill: colors.highlight,
|
|
315
|
-
quadrantPointTextFill: highlightText,
|
|
316
|
-
quadrantXAxisTextFill: colors.text,
|
|
317
|
-
quadrantYAxisTextFill: colors.text,
|
|
318
|
-
quadrantTitleFill: colors.text,
|
|
319
|
-
requirementBackground: colors.backgroundLight,
|
|
320
|
-
requirementBorderColor: colors.primary,
|
|
321
|
-
requirementTextColor: colors.text,
|
|
322
|
-
relationColor: colors.textMuted,
|
|
323
|
-
relationLabelBackground: colors.background,
|
|
324
|
-
relationLabelColor: colors.text,
|
|
325
|
-
commitLabelColor: colors.text,
|
|
326
|
-
commitLabelBackground: colors.backgroundLight,
|
|
327
|
-
tagLabelColor: primaryText,
|
|
328
|
-
tagLabelBackground: colors.primary,
|
|
329
|
-
tagLabelBorder: colors.highlight
|
|
330
|
-
};
|
|
331
|
-
palette.forEach((color, index) => {
|
|
332
|
-
const label = textOn(theme, color);
|
|
333
|
-
variables[`cScale${index}`] = color;
|
|
334
|
-
variables[`cScaleInv${index}`] = label;
|
|
335
|
-
variables[`cScaleLabel${index}`] = label;
|
|
336
|
-
variables[`cScalePeer${index}`] = label;
|
|
337
|
-
variables[`pie${index + 1}`] = color;
|
|
338
|
-
if (index < 8) {
|
|
339
|
-
variables[`git${index}`] = color;
|
|
340
|
-
variables[`gitInv${index}`] = label;
|
|
341
|
-
variables[`gitBranchLabel${index}`] = label;
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
return variables;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export {
|
|
348
|
-
calculateDuration,
|
|
349
|
-
getSegmentAtTime,
|
|
350
|
-
getBlockAtTime,
|
|
351
|
-
getCaptionAtTime,
|
|
352
|
-
pipStyleVars,
|
|
353
|
-
STARTER_THEME,
|
|
354
|
-
deriveColorPalette,
|
|
355
|
-
accentToColorScheme,
|
|
356
|
-
compileTheme,
|
|
357
|
-
parseTheme,
|
|
358
|
-
serializeTheme,
|
|
359
|
-
buildMermaidThemeVariables
|
|
360
|
-
};
|