@odla-ai/brand 0.7.1 → 0.7.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.
- package/README.md +1 -1
- package/dist/{index-r36KQK5n.d.cts → index-r6SGidYT.d.cts} +6 -1
- package/dist/{index-r36KQK5n.d.ts → index-r6SGidYT.d.ts} +6 -1
- package/dist/index.cjs +20 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-
|
|
2
|
-
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-
|
|
1
|
+
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-r6SGidYT.cjs';
|
|
2
|
+
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-r6SGidYT.cjs';
|
|
3
3
|
import { ToolHandler, Skill, ToolDef, Persona, Inference, AgentRunInput, ImageBlock, OracleContentBlock } from '@odla-ai/ai';
|
|
4
4
|
|
|
5
5
|
/** One entry of the bundle's base64 asset manifest, without its payload. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-
|
|
2
|
-
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-
|
|
1
|
+
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-r6SGidYT.js';
|
|
2
|
+
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-r6SGidYT.js';
|
|
3
3
|
import { ToolHandler, Skill, ToolDef, Persona, Inference, AgentRunInput, ImageBlock, OracleContentBlock } from '@odla-ai/ai';
|
|
4
4
|
|
|
5
5
|
/** One entry of the bundle's base64 asset manifest, without its payload. */
|
package/dist/index.js
CHANGED
|
@@ -463,6 +463,7 @@ var DESIGN_CONTENT_TYPES = /* @__PURE__ */ new Set(["text/html"]);
|
|
|
463
463
|
var HEX_RGB = /^#[0-9a-f]{3}$/;
|
|
464
464
|
var HEX_RRGGBB = /^#[0-9a-f]{6}$/;
|
|
465
465
|
var HEX_ALPHA = /^#[0-9a-f]{4}$|^#[0-9a-f]{8}$/;
|
|
466
|
+
var UI_TOKEN_NAME = /^--ui-[a-z0-9-]+$/;
|
|
466
467
|
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
467
468
|
function assertHex(value, label = "color") {
|
|
468
469
|
if (typeof value !== "string")
|
|
@@ -529,6 +530,21 @@ function assertTypographySection(c) {
|
|
|
529
530
|
out.scale = c.scale;
|
|
530
531
|
}
|
|
531
532
|
if (c.notes !== void 0) out.notes = capString(c.notes, "content.notes", 2e3);
|
|
533
|
+
if (c.tokenOverrides !== void 0) {
|
|
534
|
+
if (!isRecord(c.tokenOverrides))
|
|
535
|
+
throw new BrandInputError("content.tokenOverrides must be an object");
|
|
536
|
+
const entries = Object.entries(c.tokenOverrides);
|
|
537
|
+
if (entries.length > 64)
|
|
538
|
+
throw new BrandInputError("content.tokenOverrides must have at most 64 entries");
|
|
539
|
+
out.tokenOverrides = Object.fromEntries(entries.map(([name, raw]) => {
|
|
540
|
+
if (!UI_TOKEN_NAME.test(name))
|
|
541
|
+
throw new BrandInputError(`content.tokenOverrides.${name} must be a --ui-* token name`);
|
|
542
|
+
const value = capString(raw, `content.tokenOverrides.${name}`, 500);
|
|
543
|
+
if (/[;{}]/.test(value) || /url\s*\(/i.test(value))
|
|
544
|
+
throw new BrandInputError(`content.tokenOverrides.${name} contains an unsafe CSS value`);
|
|
545
|
+
return [name, value];
|
|
546
|
+
}));
|
|
547
|
+
}
|
|
532
548
|
return out;
|
|
533
549
|
}
|
|
534
550
|
function assertVoiceSection(c) {
|
|
@@ -3053,7 +3069,10 @@ var proposalGuardEquals = (snapshot) => ({ ...snapshot });
|
|
|
3053
3069
|
|
|
3054
3070
|
// src/routes/proposal-effects.ts
|
|
3055
3071
|
async function tokenSnapshot(swatches, typography, input, paletteId, paletteReceiptId, paletteActionDigest, typographyReceiptId, typographyActionDigest) {
|
|
3056
|
-
const compiled = compileBrandTokens({
|
|
3072
|
+
const compiled = compileBrandTokens({
|
|
3073
|
+
swatches,
|
|
3074
|
+
...typography ? { typography, overrides: typography.tokenOverrides } : {}
|
|
3075
|
+
});
|
|
3057
3076
|
const sources = {
|
|
3058
3077
|
paletteId,
|
|
3059
3078
|
paletteReceiptId,
|