@samva/markup 0.15.1 → 0.16.0
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/AGENTS.md +7 -2
- package/CHANGELOG.md +20 -0
- package/dist/assets-BSpgZOSR.js +61 -0
- package/dist/assets-BSuNT9gr.d.ts +39 -0
- package/dist/brand-Ci05p37c.js +132 -0
- package/dist/brand-footer-ClRtWnIc.d.ts +40 -0
- package/dist/brand-footer-DXVGsKE5.js +746 -0
- package/dist/{assets-tISHaQNF.d.ts → brand-jFV6YtSV.d.ts} +2 -40
- package/dist/brand-sample.d.ts +4 -0
- package/dist/brand-sample.js +2 -0
- package/dist/brand.d.ts +2 -1
- package/dist/brand.js +2 -1
- package/dist/{ir-DNL6H7jA.js → cascade-DoLWZ66g.js} +1 -5
- package/dist/compiler.d.ts +5 -38
- package/dist/compiler.js +9 -743
- package/dist/{diagnostic-codes-UXwOO3A-.js → diagnostic-codes-8XDLR9ef.js} +1 -36
- package/dist/diagnostic-model-DJtqbETd.js +36 -0
- package/dist/diagnostics.js +2 -1
- package/dist/edit.js +2 -2
- package/dist/ir-KJLFW08u.js +5 -0
- package/dist/{profile-AatO_SvP.js → profile-BsY4dkan.js} +10 -105
- package/dist/{render-DpYouYYG.js → render-CVnXZMyK.js} +1 -1
- package/dist/{render-BdvewoQt.d.ts → render-CuZej25A.d.ts} +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +2 -2
- package/dist/theme-imports-u_P0ygvQ.js +102 -0
- package/package.json +5 -1
- package/dist/brand-nreeKWxF.js +0 -200
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as BrandPlugin } from "./brand-plugin-CHhcei-j.js";
|
|
2
|
-
import { r as EmailDiagnostic } from "./diagnostics-CUYlQ_6x.js";
|
|
3
1
|
import { r as EmailNode } from "./jsx-runtime-DC7xG0aA.js";
|
|
2
|
+
import { t as BrandPlugin } from "./brand-plugin-CHhcei-j.js";
|
|
4
3
|
//#region src/email/brand.d.ts
|
|
5
4
|
interface EmailBrandAddress {
|
|
6
5
|
readonly street1: string;
|
|
@@ -74,41 +73,4 @@ declare const withoutUnsubscribeRow: (rendered: {
|
|
|
74
73
|
readonly text: string | undefined;
|
|
75
74
|
};
|
|
76
75
|
//#endregion
|
|
77
|
-
|
|
78
|
-
/** Files a template may import, and what they are served as. */
|
|
79
|
-
declare const ASSET_CONTENT_TYPES: Readonly<Record<string, string>>;
|
|
80
|
-
interface AssetEntry {
|
|
81
|
-
/** Project-relative path the template imported. */
|
|
82
|
-
readonly path: string;
|
|
83
|
-
/** SHA-256 of the exact bytes, lowercase hex. */
|
|
84
|
-
readonly digest: string;
|
|
85
|
-
readonly bytes: number;
|
|
86
|
-
readonly contentType: string;
|
|
87
|
-
/** `<digest><ext>` — the name the asset has under any base. */
|
|
88
|
-
readonly fileName: string;
|
|
89
|
-
}
|
|
90
|
-
interface AssetManifest {
|
|
91
|
-
/** Where these assets are served from in this build. */
|
|
92
|
-
readonly base: string;
|
|
93
|
-
readonly assets: readonly AssetEntry[];
|
|
94
|
-
}
|
|
95
|
-
/** True when the compiler turns this import into a content-addressed asset. */
|
|
96
|
-
declare const isAssetPath: (path: string) => boolean;
|
|
97
|
-
/** Address one file by its content. */
|
|
98
|
-
declare const assetEntry: (path: string, bytes: Uint8Array) => Promise<AssetEntry>;
|
|
99
|
-
/**
|
|
100
|
-
* The URL an asset has under a base. The base is a build input: publication
|
|
101
|
-
* passes its hosted origin, and a local export passes whatever it will serve
|
|
102
|
-
* the exported files from.
|
|
103
|
-
*/
|
|
104
|
-
declare const assetUrl: (entry: AssetEntry, base: string) => string;
|
|
105
|
-
/** Record, but never fetch, a URL the template points at. */
|
|
106
|
-
declare const isExternalAsset: (reference: string) => boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Reject an asset base that would produce URLs a client will not load. The
|
|
109
|
-
* relative forms are the ones a page on disk resolves against its own
|
|
110
|
-
* directory, which is what a local export writes.
|
|
111
|
-
*/
|
|
112
|
-
declare const checkAssetBase: (base: string) => readonly EmailDiagnostic[];
|
|
113
|
-
//#endregion
|
|
114
|
-
export { EmailBrandSocialLink as _, assetUrl as a, renderedFooterMarkers as b, isExternalAsset as c, BrandFooterProps as d, BrandLogoProps as f, EmailBrandFooter as g, EmailBrandAssets as h, assetEntry as i, BRAND_COMPONENT_CLASSES as l, EmailBrandAddress as m, AssetEntry as n, checkAssetBase as o, EmailBrand as p, AssetManifest as r, isAssetPath as s, ASSET_CONTENT_TYPES as t, BrandComponents as u, RenderedFooterMarkers as v, withoutUnsubscribeRow as x, brandComponents as y };
|
|
76
|
+
export { EmailBrand as a, EmailBrandFooter as c, brandComponents as d, renderedFooterMarkers as f, BrandLogoProps as i, EmailBrandSocialLink as l, BrandComponents as n, EmailBrandAddress as o, withoutUnsubscribeRow as p, BrandFooterProps as r, EmailBrandAssets as s, BRAND_COMPONENT_CLASSES as t, RenderedFooterMarkers as u };
|
package/dist/brand.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as BrandPlugin } from "./brand-plugin-CHhcei-j.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as EmailBrand, c as EmailBrandFooter, d as brandComponents, f as renderedFooterMarkers, i as BrandLogoProps, l as EmailBrandSocialLink, n as BrandComponents, o as EmailBrandAddress, p as withoutUnsubscribeRow, r as BrandFooterProps, s as EmailBrandAssets, t as BRAND_COMPONENT_CLASSES, u as RenderedFooterMarkers } from "./brand-jFV6YtSV.js";
|
|
3
|
+
import { a as assetUrl, c as isExternalAsset, i as assetEntry, n as AssetEntry, o as checkAssetBase, r as AssetManifest, s as isAssetPath, t as ASSET_CONTENT_TYPES } from "./assets-BSuNT9gr.js";
|
|
3
4
|
import { t as Diagnostic } from "./diagnostic-model-DxthUZBT.js";
|
|
4
5
|
import { Result } from "better-result";
|
|
5
6
|
//#region src/email/samva-brand-plugin.d.ts
|
package/dist/brand.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { D as samvaBrandPlugin } from "./html-BvRFepeO.js";
|
|
2
2
|
import { a as THEME_COLOR_ROLES, c as foregroundDefaults, i as THEME_COLORS, l as parseBrandCss, n as DEFAULT_THEME_CSS, o as THEME_TOKENS, r as FILL_COLORS, s as contrastForeground, t as DEFAULT_THEME, u as printBrandCss } from "./theme-css-s9QwD5Ko.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as isAssetPath, i as checkAssetBase, n as assetEntry, o as isExternalAsset, r as assetUrl, t as ASSET_CONTENT_TYPES } from "./assets-BSpgZOSR.js";
|
|
4
|
+
import { i as withoutUnsubscribeRow, n as brandComponents, r as renderedFooterMarkers, t as BRAND_COMPONENT_CLASSES } from "./brand-Ci05p37c.js";
|
|
4
5
|
export { ASSET_CONTENT_TYPES, BRAND_COMPONENT_CLASSES, DEFAULT_THEME, DEFAULT_THEME_CSS, FILL_COLORS, THEME_COLORS, THEME_COLOR_ROLES, THEME_TOKENS, assetEntry, assetUrl, brandComponents, checkAssetBase, contrastForeground, foregroundDefaults, isAssetPath, isExternalAsset, parseBrandCss, printBrandCss, renderedFooterMarkers, samvaBrandPlugin, withoutUnsubscribeRow };
|
|
@@ -698,8 +698,4 @@ const applyStylesheet = (root, sheet, options = {}) => {
|
|
|
698
698
|
};
|
|
699
699
|
};
|
|
700
700
|
//#endregion
|
|
701
|
-
|
|
702
|
-
/** The IR version this package writes. A publication pins the version it was built with. */
|
|
703
|
-
const SML_IR_VERSION = 1;
|
|
704
|
-
//#endregion
|
|
705
|
-
export { downlevelMediaQuery as a, renderHeadCss as c, matchesSelector as d, unquote as f, renderDarkRules as i, resolveVariables as l, DARK_CLASS_PREFIX as n, finalizeValue as o, applyStylesheet as r, foldCalc as s, SML_IR_VERSION as t, classListOf as u };
|
|
701
|
+
export { finalizeValue as a, resolveVariables as c, unquote as d, downlevelMediaQuery as i, classListOf as l, applyStylesheet as n, foldCalc as o, renderDarkRules as r, renderHeadCss as s, DARK_CLASS_PREFIX as t, matchesSelector as u };
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { n as parseBrandSpecifier, t as BrandPlugin } from "./brand-plugin-CHhcei-j.js";
|
|
2
1
|
import { a as TemplateDiagnostic, r as EmailDiagnostic } from "./diagnostics-CUYlQ_6x.js";
|
|
3
2
|
import { r as EmailNode } from "./jsx-runtime-DC7xG0aA.js";
|
|
4
|
-
import { n as AssetEntry, p as EmailBrand, u as BrandComponents } from "./assets-tISHaQNF.js";
|
|
5
|
-
import { C as Compound, D as EmittedPosition, S as CompiledSelector, T as matchesSelector, _ as Specificity, b as parseStylesheet, ct as TemplateIr, g as CssRule, h as CssDeclaration, r as RenderedEmail, v as Stylesheet, w as classListOf, x as Ancestry, y as compileSelector } from "./render-BdvewoQt.js";
|
|
6
3
|
import { a as TEMPLATE_NAME_PATTERN, n as EmailContent } from "./template-B-UDXK8a.js";
|
|
4
|
+
import { n as parseBrandSpecifier, t as BrandPlugin } from "./brand-plugin-CHhcei-j.js";
|
|
5
|
+
import { a as EmailBrand } from "./brand-jFV6YtSV.js";
|
|
6
|
+
import { C as Compound, D as EmittedPosition, S as CompiledSelector, T as matchesSelector, _ as Specificity, b as parseStylesheet, ct as TemplateIr, g as CssRule, h as CssDeclaration, v as Stylesheet, w as classListOf, x as Ancestry, y as compileSelector } from "./render-CuZej25A.js";
|
|
7
|
+
import { n as renderBrandFooter, r as renderBrandSample, t as RenderedBrandFooter } from "./brand-footer-ClRtWnIc.js";
|
|
8
|
+
import { n as AssetEntry } from "./assets-BSuNT9gr.js";
|
|
7
9
|
import { caniemail } from "caniemail";
|
|
8
10
|
//#region src/email/compatibility.d.ts
|
|
9
11
|
type CaniemailClient = Parameters<typeof caniemail>[0]["clients"][number];
|
|
@@ -222,41 +224,6 @@ declare const projectBrandSpecifier: (files: Readonly<Record<string, string | Ui
|
|
|
222
224
|
/** Read a whole project, then compile the classes its scripts used. */
|
|
223
225
|
declare const transformProject: (files: Readonly<Record<string, string | Uint8Array>>, options: TransformOptions) => Promise<ProjectTransform>;
|
|
224
226
|
//#endregion
|
|
225
|
-
//#region src/email/brand-footer.d.ts
|
|
226
|
-
/** A footer block for the send path to append, and its plain-text tail. */
|
|
227
|
-
interface RenderedBrandFooter {
|
|
228
|
-
readonly html: string;
|
|
229
|
-
readonly text: string;
|
|
230
|
-
/**
|
|
231
|
-
* The rules the footer needs in the message's `<head>`: its dark-mode colors and the
|
|
232
|
-
* `dark:` swap of the brand logo. Empty when it needs none.
|
|
233
|
-
*/
|
|
234
|
-
readonly headCss: string;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Render `BrandFooter` against a brand on its own, for the send path to
|
|
238
|
-
* append to a message whose template renders no footer of its own. It
|
|
239
|
-
* compiles the same component, styled by the same brand theme, a template
|
|
240
|
-
* would get from its brand import. Without `unsubscribe` the unsubscribe row is
|
|
241
|
-
* left out.
|
|
242
|
-
*/
|
|
243
|
-
declare const renderBrandFooter: (brand: EmailBrand, options: {
|
|
244
|
-
readonly unsubscribe: boolean;
|
|
245
|
-
readonly brandPlugin?: BrandPlugin | undefined;
|
|
246
|
-
}) => Promise<RenderedBrandFooter>;
|
|
247
|
-
/**
|
|
248
|
-
* Render content against a brand as a project whose `theme.css` imports only
|
|
249
|
-
* the brand renders it: Tailwind compiles the brand theme for
|
|
250
|
-
* the classes the content names, `BrandLogo` and `BrandFooter` are bound to the
|
|
251
|
-
* brand, and the render inlines the result. A brand preview renders through
|
|
252
|
-
* this, so it shows what a template importing the brand compiles to.
|
|
253
|
-
*/
|
|
254
|
-
declare const renderBrandSample: (brand: EmailBrand, sample: {
|
|
255
|
-
/** Every class the content names; nothing is discovered from source here. */
|
|
256
|
-
readonly classes: readonly string[];
|
|
257
|
-
readonly render: (components: BrandComponents) => EmailContent;
|
|
258
|
-
}, brandPlugin?: BrandPlugin) => Promise<RenderedEmail>;
|
|
259
|
-
//#endregion
|
|
260
227
|
//#region src/sml/lower-project.d.ts
|
|
261
228
|
interface CompiledTemplate {
|
|
262
229
|
/** The IR, or `undefined` when a finding blocks it. */
|