@bettercms-ai/types 1.64.0 → 1.67.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/dist/index.d.ts +199 -9
- package/dist/index.js +267 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,6 +26,9 @@ function bodySchemaOf(value) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// src/block.ts
|
|
29
|
+
var THEME_TOKENS = ["inherit", "light", "dark"];
|
|
30
|
+
var BG_TOKENS = ["none", "surface", "muted", "accent", "dark", "custom"];
|
|
31
|
+
var CONTENT_WIDTH_TOKENS = ["narrow", "default", "wide", "full"];
|
|
29
32
|
var WINDOW_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
30
33
|
function normalizeWindow(value) {
|
|
31
34
|
if (value == null) return { window: null };
|
|
@@ -110,14 +113,14 @@ var UNIT = "(?:[kKmMbBxsdgh]|bn|hr|hrs|min|ms|kg|mg|lb|lbs|oz|km|cm|mm|mi|ft|[kK
|
|
|
110
113
|
var SUFFIX = new RegExp(`^(?:\\s?(?:\\p{Sc}|[%\u2030\xD7]|${UNIT}))?\\+?(?:\\s?/\\s?\\p{L}{1,10}){0,2}[)\\]*\u2020]?$`, "u");
|
|
111
114
|
var PREFIX = /^(?:[^\p{L}\p{N}\s.,'\u2019#№\-−–—]{1,3}\s?)?$/u;
|
|
112
115
|
var fractionDigits = (value) => {
|
|
113
|
-
const
|
|
114
|
-
return
|
|
116
|
+
const text2 = value.toFixed(6).replace(/0+$/, "");
|
|
117
|
+
return text2.length - text2.indexOf(".") - 1;
|
|
115
118
|
};
|
|
116
119
|
function readNumberFormat(raw) {
|
|
117
120
|
const o = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
118
|
-
const
|
|
119
|
-
const prefix =
|
|
120
|
-
const suffix =
|
|
121
|
+
const text2 = (v, max) => typeof v === "string" && v.length <= max && !new RegExp("\\p{Nd}", "u").test(v) ? v : void 0;
|
|
122
|
+
const prefix = text2(o.prefix, 8);
|
|
123
|
+
const suffix = text2(o.suffix, 24);
|
|
121
124
|
const group = typeof o.group === "string" && GROUPS.includes(o.group) ? o.group : void 0;
|
|
122
125
|
const decimal = o.decimal === "," ? "," : void 0;
|
|
123
126
|
const decimals = typeof o.decimals === "number" && Number.isInteger(o.decimals) && o.decimals > 0 && o.decimals <= 6 ? o.decimals : void 0;
|
|
@@ -140,14 +143,14 @@ function formatNumber(value, format = {}) {
|
|
|
140
143
|
const grouped = format.group ? groupDigits(int, format.group, format.grouping) : int;
|
|
141
144
|
return `${value < 0 ? "-" : ""}${format.prefix ?? ""}${grouped}${frac ? `${format.decimal ?? "."}${frac}` : ""}${format.suffix ?? ""}`;
|
|
142
145
|
}
|
|
143
|
-
function parseNumberText(
|
|
144
|
-
if (typeof
|
|
145
|
-
const digits = /\d/.exec(
|
|
146
|
+
function parseNumberText(text2, opts = {}) {
|
|
147
|
+
if (typeof text2 !== "string" || text2.length === 0 || text2.length > 40) return null;
|
|
148
|
+
const digits = /\d/.exec(text2);
|
|
146
149
|
if (!digits) return null;
|
|
147
150
|
const start = digits.index;
|
|
148
|
-
const body = /^\d[\d.,'\u2019 \u00a0\u202f]*\d|^\d/.exec(
|
|
149
|
-
const prefix =
|
|
150
|
-
const suffix =
|
|
151
|
+
const body = /^\d[\d.,'\u2019 \u00a0\u202f]*\d|^\d/.exec(text2.slice(start))[0];
|
|
152
|
+
const prefix = text2.slice(0, start);
|
|
153
|
+
const suffix = text2.slice(start + body.length);
|
|
151
154
|
if (/\d/.test(suffix) || !PREFIX.test(prefix) || !SUFFIX.test(suffix)) return null;
|
|
152
155
|
if (opts.machine && (prefix || suffix || !/^\d+(\.\d+)?$/.test(body))) return null;
|
|
153
156
|
if (/[)\]]$/.test(suffix) !== /^[([]/.test(prefix)) return null;
|
|
@@ -187,7 +190,7 @@ function parseNumberText(text, opts = {}) {
|
|
|
187
190
|
...decimal === "," ? { decimal } : {},
|
|
188
191
|
...frac ? { decimals: frac.length } : {}
|
|
189
192
|
};
|
|
190
|
-
return Number.isFinite(value) && frac.length <= 6 && formatNumber(value, format) ===
|
|
193
|
+
return Number.isFinite(value) && frac.length <= 6 && formatNumber(value, format) === text2 ? { value, format } : null;
|
|
191
194
|
}
|
|
192
195
|
|
|
193
196
|
// src/block-bindings.ts
|
|
@@ -264,7 +267,7 @@ function formatPropsAttribute(entries) {
|
|
|
264
267
|
}
|
|
265
268
|
function parsePropsAttribute(value) {
|
|
266
269
|
if (!value) return [];
|
|
267
|
-
return value.split(";").map((entry) => entry.split("|")).filter((parts) => parts.length === 3 && parts.every(Boolean)).map(([address, kind,
|
|
270
|
+
return value.split(";").map((entry) => entry.split("|")).filter((parts) => parts.length === 3 && parts.every(Boolean)).map(([address, kind, attr3]) => ({ address, kind, attr: attr3 }));
|
|
268
271
|
}
|
|
269
272
|
function componentPropTargetKey(prop) {
|
|
270
273
|
if (!prop?.key || !prop.target?.blockId) return null;
|
|
@@ -277,6 +280,12 @@ function componentInstanceAddresses(instanceBlockId, props, owner) {
|
|
|
277
280
|
if (!prop?.key || !prop.target?.blockId) continue;
|
|
278
281
|
const from = componentPropTargetKey(prop);
|
|
279
282
|
if (!out.has(from)) out.set(from, `${instance}__overrides.${prop.key}`);
|
|
283
|
+
if (prop.target.path === "props") {
|
|
284
|
+
const text2 = `${prop.target.blockId}__text`;
|
|
285
|
+
const href = `${prop.target.blockId}__href`;
|
|
286
|
+
if (!out.has(text2)) out.set(text2, `${instance}__overrides.${prop.key}.label`);
|
|
287
|
+
if (!out.has(href)) out.set(href, `${instance}__overrides.${prop.key}.href`);
|
|
288
|
+
}
|
|
280
289
|
}
|
|
281
290
|
return out;
|
|
282
291
|
}
|
|
@@ -3405,8 +3414,8 @@ function derivedPairs(candidates) {
|
|
|
3405
3414
|
if (!suffix) return;
|
|
3406
3415
|
const stem = key.slice(0, suffix.index);
|
|
3407
3416
|
const parent = link.key.slice(0, link.key.length - key.length);
|
|
3408
|
-
const texts = candidates.map((
|
|
3409
|
-
({ text, textIndex }) => textIndex !== linkIndex && !out.has(textIndex) && isText(
|
|
3417
|
+
const texts = candidates.map((text2, textIndex) => ({ text: text2, textIndex })).filter(
|
|
3418
|
+
({ text: text2, textIndex }) => textIndex !== linkIndex && !out.has(textIndex) && isText(text2) && text2.key.startsWith(parent) && sameButTag(leaf(text2.key), stem)
|
|
3410
3419
|
);
|
|
3411
3420
|
if (texts.length !== 1) return;
|
|
3412
3421
|
const pair = `${texts[0].textIndex}:${linkIndex}`;
|
|
@@ -3443,8 +3452,8 @@ function buttonLinkPairs(candidates) {
|
|
|
3443
3452
|
}
|
|
3444
3453
|
}
|
|
3445
3454
|
const uses = /* @__PURE__ */ new Map();
|
|
3446
|
-
for (const [
|
|
3447
|
-
uses.set(
|
|
3455
|
+
for (const [text2, link] of proposals.values()) {
|
|
3456
|
+
uses.set(text2, (uses.get(text2) ?? 0) + 1);
|
|
3448
3457
|
uses.set(link, (uses.get(link) ?? 0) + 1);
|
|
3449
3458
|
}
|
|
3450
3459
|
return [...proposals.values()].filter(([t, l]) => !ambiguous.has(t) && !ambiguous.has(l) && uses.get(t) === 1 && uses.get(l) === 1).sort((a, b) => Math.min(...a) - Math.min(...b));
|
|
@@ -4084,7 +4093,7 @@ function cellHtml(t, col, row, c, fn, asHeader) {
|
|
|
4084
4093
|
}
|
|
4085
4094
|
return { inner: inner + sup, align: alignOf(col, type) };
|
|
4086
4095
|
}
|
|
4087
|
-
var TABLE_CSS = '.bt-table .bt-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bt-table .bt-scroll{overflow-x:auto}.bt-table table{border-collapse:collapse;width:100%}.bt-table th,.bt-table td{padding:8px 12px;border-bottom:1px solid #e5e5e5;text-align:start;vertical-align:top}.bt-table [data-align="end"]{text-align:end}.bt-table [data-align="center"]{text-align:center}.bt-table caption{text-align:start;font-weight:600;padding-bottom:8px}.bt-table .bt-notes{font-size:.9em;margin-top:8px}';
|
|
4096
|
+
var TABLE_CSS = '.bt-table .bt-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bt-table .bt-scroll{overflow-x:auto;position:relative}.bt-table table{border-collapse:collapse;width:100%}.bt-table th,.bt-table td{padding:8px 12px;border-bottom:1px solid #e5e5e5;text-align:start;vertical-align:top}.bt-table [data-align="end"]{text-align:end}.bt-table [data-align="center"]{text-align:center}.bt-table caption{text-align:start;font-weight:600;padding-bottom:8px}.bt-table .bt-notes{font-size:.9em;margin-top:8px}';
|
|
4088
4097
|
function renderTableHtml(input) {
|
|
4089
4098
|
const t = readTable(input);
|
|
4090
4099
|
const id = (t.id ?? "tbl").replace(/[^\w-]/g, "") || "tbl";
|
|
@@ -4230,6 +4239,145 @@ function tableSearchText(input) {
|
|
|
4230
4239
|
// src/content-model.ts
|
|
4231
4240
|
var OPTION_DESCRIPTION_MAX = 140;
|
|
4232
4241
|
|
|
4242
|
+
// src/form-upload.ts
|
|
4243
|
+
var FORM_UPLOAD = {
|
|
4244
|
+
/** Per-file cap on every plan, in MB. */
|
|
4245
|
+
maxSizeMb: 10,
|
|
4246
|
+
/** The most a site whose plan may configure the cap can raise it to, in MB. */
|
|
4247
|
+
maxSizeMbCeiling: 25,
|
|
4248
|
+
/** Files per field on every plan. */
|
|
4249
|
+
maxFiles: 5,
|
|
4250
|
+
/** Files per field where the plan may configure limits. */
|
|
4251
|
+
maxFilesCeiling: 10
|
|
4252
|
+
};
|
|
4253
|
+
var FORM_UPLOAD_PRESETS = {
|
|
4254
|
+
images: ["jpg", "jpeg", "png", "gif", "webp", "heic"],
|
|
4255
|
+
pdf: ["pdf"],
|
|
4256
|
+
documents: ["doc", "docx", "odt", "rtf", "txt"],
|
|
4257
|
+
spreadsheets: ["xls", "xlsx", "ods", "csv"],
|
|
4258
|
+
archives: ["zip"]
|
|
4259
|
+
};
|
|
4260
|
+
var FORM_UPLOAD_DEFAULT_ACCEPT = [
|
|
4261
|
+
...FORM_UPLOAD_PRESETS.images,
|
|
4262
|
+
...FORM_UPLOAD_PRESETS.pdf,
|
|
4263
|
+
...FORM_UPLOAD_PRESETS.documents,
|
|
4264
|
+
...FORM_UPLOAD_PRESETS.spreadsheets
|
|
4265
|
+
];
|
|
4266
|
+
var FORM_UPLOAD_REFUSED_EXTENSIONS = [
|
|
4267
|
+
"exe",
|
|
4268
|
+
"msi",
|
|
4269
|
+
"msp",
|
|
4270
|
+
"mst",
|
|
4271
|
+
"bat",
|
|
4272
|
+
"cmd",
|
|
4273
|
+
"com",
|
|
4274
|
+
"scr",
|
|
4275
|
+
"pif",
|
|
4276
|
+
"cpl",
|
|
4277
|
+
"dll",
|
|
4278
|
+
"sys",
|
|
4279
|
+
"drv",
|
|
4280
|
+
"vbs",
|
|
4281
|
+
"vbe",
|
|
4282
|
+
"js",
|
|
4283
|
+
"jse",
|
|
4284
|
+
"mjs",
|
|
4285
|
+
"cjs",
|
|
4286
|
+
"wsf",
|
|
4287
|
+
"wsh",
|
|
4288
|
+
"ps1",
|
|
4289
|
+
"psm1",
|
|
4290
|
+
"psd1",
|
|
4291
|
+
"hta",
|
|
4292
|
+
"sh",
|
|
4293
|
+
"bash",
|
|
4294
|
+
"zsh",
|
|
4295
|
+
"csh",
|
|
4296
|
+
"ksh",
|
|
4297
|
+
"fish",
|
|
4298
|
+
"command",
|
|
4299
|
+
"action",
|
|
4300
|
+
"workflow",
|
|
4301
|
+
"jar",
|
|
4302
|
+
"class",
|
|
4303
|
+
"app",
|
|
4304
|
+
"dmg",
|
|
4305
|
+
"pkg",
|
|
4306
|
+
"deb",
|
|
4307
|
+
"rpm",
|
|
4308
|
+
"apk",
|
|
4309
|
+
"ipa",
|
|
4310
|
+
"appx",
|
|
4311
|
+
"msix",
|
|
4312
|
+
"lnk",
|
|
4313
|
+
"url",
|
|
4314
|
+
"scf",
|
|
4315
|
+
"reg",
|
|
4316
|
+
"inf",
|
|
4317
|
+
"ins",
|
|
4318
|
+
"chm",
|
|
4319
|
+
"gadget",
|
|
4320
|
+
"html",
|
|
4321
|
+
"htm",
|
|
4322
|
+
"xhtml",
|
|
4323
|
+
"shtml",
|
|
4324
|
+
"svg",
|
|
4325
|
+
"php",
|
|
4326
|
+
"phtml",
|
|
4327
|
+
"asp",
|
|
4328
|
+
"aspx",
|
|
4329
|
+
"jsp",
|
|
4330
|
+
"cgi",
|
|
4331
|
+
"py",
|
|
4332
|
+
"rb",
|
|
4333
|
+
"pl",
|
|
4334
|
+
"iso",
|
|
4335
|
+
"img",
|
|
4336
|
+
"vhd",
|
|
4337
|
+
"vhdx",
|
|
4338
|
+
"bin",
|
|
4339
|
+
"elf",
|
|
4340
|
+
"so",
|
|
4341
|
+
"dylib",
|
|
4342
|
+
"docm",
|
|
4343
|
+
"xlsm",
|
|
4344
|
+
"pptm",
|
|
4345
|
+
"dotm",
|
|
4346
|
+
"xltm",
|
|
4347
|
+
"xlam",
|
|
4348
|
+
"xll",
|
|
4349
|
+
"mht",
|
|
4350
|
+
"mhtml",
|
|
4351
|
+
"msc",
|
|
4352
|
+
"scpt",
|
|
4353
|
+
"vb",
|
|
4354
|
+
"ws",
|
|
4355
|
+
"jnlp",
|
|
4356
|
+
"swf"
|
|
4357
|
+
];
|
|
4358
|
+
function isRefusedUploadExtension(ext) {
|
|
4359
|
+
return FORM_UPLOAD_REFUSED_EXTENSIONS.includes(ext.toLowerCase());
|
|
4360
|
+
}
|
|
4361
|
+
function fileExtension(name) {
|
|
4362
|
+
const base = name.slice(Math.max(name.lastIndexOf("/"), name.lastIndexOf("\\")) + 1);
|
|
4363
|
+
const dot = base.lastIndexOf(".");
|
|
4364
|
+
return dot <= 0 || dot === base.length - 1 ? "" : base.slice(dot + 1).toLowerCase();
|
|
4365
|
+
}
|
|
4366
|
+
function formUploadAccept(accept) {
|
|
4367
|
+
const own2 = [...new Set((accept ?? []).map((e) => e.trim().replace(/^\./, "").toLowerCase()))].filter((e) => e && !isRefusedUploadExtension(e));
|
|
4368
|
+
return own2.length ? own2 : [...FORM_UPLOAD_DEFAULT_ACCEPT];
|
|
4369
|
+
}
|
|
4370
|
+
function formUploadLimits(rules, configurable) {
|
|
4371
|
+
const files = Math.max(1, Math.floor(rules?.maxFiles ?? 1));
|
|
4372
|
+
return {
|
|
4373
|
+
maxFiles: Math.min(files, configurable ? FORM_UPLOAD.maxFilesCeiling : FORM_UPLOAD.maxFiles),
|
|
4374
|
+
maxSizeMb: configurable ? Math.min(Math.max(1, rules?.maxSizeMb ?? FORM_UPLOAD.maxSizeMb), FORM_UPLOAD.maxSizeMbCeiling) : FORM_UPLOAD.maxSizeMb
|
|
4375
|
+
};
|
|
4376
|
+
}
|
|
4377
|
+
function fileFieldLimits(field) {
|
|
4378
|
+
return { ...formUploadLimits(field.validation, true), accept: formUploadAccept(field.validation?.accept) };
|
|
4379
|
+
}
|
|
4380
|
+
|
|
4233
4381
|
// src/locator.ts
|
|
4234
4382
|
var LANDMARK_SELECTOR = "header,nav,footer";
|
|
4235
4383
|
var LANDMARK_TAGS = /* @__PURE__ */ new Set(["HEADER", "NAV", "FOOTER"]);
|
|
@@ -4895,7 +5043,83 @@ function isVariantVisible(prop, values, props) {
|
|
|
4895
5043
|
|
|
4896
5044
|
// src/heading-id.ts
|
|
4897
5045
|
var slugify = (s) => s.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "section";
|
|
5046
|
+
|
|
5047
|
+
// src/icon-value.ts
|
|
5048
|
+
import { iconSvg as iconSvg2 } from "@bettercms-ai/icons/markup";
|
|
5049
|
+
var ICON_SOURCES = ["pack", "library", "upload"];
|
|
5050
|
+
var DEFAULT_ICON_SOURCES = ["pack", "upload"];
|
|
5051
|
+
var ICON_LABEL_MAX = 80;
|
|
5052
|
+
function resolveIconOptions(o) {
|
|
5053
|
+
const sources = (o?.sources?.length ? o.sources : DEFAULT_ICON_SOURCES).filter((s, i, a) => ICON_SOURCES.includes(s) && a.indexOf(s) === i);
|
|
5054
|
+
return { sources, sets: o?.sets?.length ? o.sets : void 0, allowColor: o?.allowColor !== false, decorative: o?.decorative ?? "always" };
|
|
5055
|
+
}
|
|
5056
|
+
var isObj2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
5057
|
+
var text = (v) => typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
5058
|
+
var isUrlish = (s) => /[/.]/.test(s);
|
|
5059
|
+
function normalizeIcon(v) {
|
|
5060
|
+
if (typeof v === "string") {
|
|
5061
|
+
const s = v.trim();
|
|
5062
|
+
return !s ? null : isUrlish(s) ? { source: "upload", url: s } : { source: "pack", name: s };
|
|
5063
|
+
}
|
|
5064
|
+
if (!isObj2(v)) return null;
|
|
5065
|
+
const label = text(v.label) ?? (v.source === void 0 ? text(v.alt) : void 0);
|
|
5066
|
+
const withLabel = (x) => label ? { ...x, label } : x;
|
|
5067
|
+
const url = text(v.url);
|
|
5068
|
+
if (v.source === "pack") return text(v.name) ? withLabel({ source: "pack", name: text(v.name) }) : null;
|
|
5069
|
+
if (v.source === "library") return text(v.id) && url ? withLabel({ source: "library", id: text(v.id), url, ...v.followsText === true ? { followsText: true } : {} }) : null;
|
|
5070
|
+
if (v.source === "upload" || v.source === void 0) return url ? withLabel({ source: "upload", url, ...text(v.assetId) ? { assetId: text(v.assetId) } : {} }) : null;
|
|
5071
|
+
return null;
|
|
5072
|
+
}
|
|
5073
|
+
function compactIcon(v) {
|
|
5074
|
+
if (!v) return "";
|
|
5075
|
+
if (v.source === "pack" && !v.label) return v.name;
|
|
5076
|
+
if (v.source === "upload" && !v.label && !v.assetId) return v.url;
|
|
5077
|
+
return v;
|
|
5078
|
+
}
|
|
5079
|
+
var isIconObjectForm = (v) => isObj2(v) && typeof v.source === "string";
|
|
5080
|
+
function iconIdentity(v) {
|
|
5081
|
+
const n = normalizeIcon(v);
|
|
5082
|
+
if (!n) return "";
|
|
5083
|
+
return n.source === "pack" ? `pack:${n.name}` : n.source === "library" ? `library:${n.id}` : `upload:${n.assetId ?? n.url}`;
|
|
5084
|
+
}
|
|
5085
|
+
function withIconLabel(v, label) {
|
|
5086
|
+
const n = normalizeIcon(v);
|
|
5087
|
+
if (!n) return "";
|
|
5088
|
+
const { label: _old, ...rest } = n;
|
|
5089
|
+
return compactIcon(label.trim() ? { ...rest, label } : rest);
|
|
5090
|
+
}
|
|
5091
|
+
function iconSrc(v) {
|
|
5092
|
+
const n = normalizeIcon(v);
|
|
5093
|
+
if (!n) return null;
|
|
5094
|
+
const label = n.label ? { label: n.label } : {};
|
|
5095
|
+
if (n.source === "pack") return { name: n.name, ...label };
|
|
5096
|
+
return { url: n.url, followsText: n.source === "library" && n.followsText === true, ...label };
|
|
5097
|
+
}
|
|
5098
|
+
function iconValueProblem(v, knownName, isUrl) {
|
|
5099
|
+
const n = normalizeIcon(v);
|
|
5100
|
+
if (!n) return "must be an icon name (bettercms://icons/dock), an image url, or an icon object";
|
|
5101
|
+
if (n.label && n.label.length > ICON_LABEL_MAX) return `label must be at most ${ICON_LABEL_MAX} characters`;
|
|
5102
|
+
if (n.source === "pack") return knownName(n.name) ? null : `must be an icon name (bettercms://icons/dock): "${n.name}" is not in the icon set`;
|
|
5103
|
+
return isUrl(n.url) ? null : "must carry a fetchable url";
|
|
5104
|
+
}
|
|
5105
|
+
var attr2 = (v) => v.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
5106
|
+
function iconHtml(v, className = "") {
|
|
5107
|
+
const src = iconSrc(v);
|
|
5108
|
+
if (!src) return "";
|
|
5109
|
+
const cls = className ? ` class="${attr2(className)}"` : "";
|
|
5110
|
+
const named = src.label ? ` role="img" aria-label="${attr2(src.label)}"` : ` aria-hidden="true"`;
|
|
5111
|
+
if ("name" in src) {
|
|
5112
|
+
const svg = iconSvg2(src.name, className);
|
|
5113
|
+
return svg && src.label ? `<span${named}>${svg}</span>` : svg;
|
|
5114
|
+
}
|
|
5115
|
+
if (src.followsText) {
|
|
5116
|
+
const mask = `url("${attr2(src.url)}") center / contain no-repeat`;
|
|
5117
|
+
return `<span data-bcms-icon-url="${attr2(src.url)}"${cls}${named} style="display:inline-block;width:1em;height:1em;background-color:currentColor;mask:${mask};-webkit-mask:${mask}"></span>`;
|
|
5118
|
+
}
|
|
5119
|
+
return `<img src="${attr2(src.url)}" alt="${attr2(src.label ?? "")}"${cls} width="16" height="16" style="width:1em;height:1em;object-fit:contain">`;
|
|
5120
|
+
}
|
|
4898
5121
|
export {
|
|
5122
|
+
BG_TOKENS,
|
|
4899
5123
|
BLOCK_BINDINGS,
|
|
4900
5124
|
BLOCK_FIELD_TYPES,
|
|
4901
5125
|
BLOCK_FIELD_TYPES_RENDERABLE_NOW,
|
|
@@ -4915,7 +5139,9 @@ export {
|
|
|
4915
5139
|
CODE_SLOT_PREFIX,
|
|
4916
5140
|
COMPONENT_GATE_CODES,
|
|
4917
5141
|
COMPONENT_PROP_TYPES,
|
|
5142
|
+
CONTENT_WIDTH_TOKENS,
|
|
4918
5143
|
CONTROL_HELP,
|
|
5144
|
+
DEFAULT_ICON_SOURCES,
|
|
4919
5145
|
DEFAULT_VARIANT,
|
|
4920
5146
|
DEPTH_MAX,
|
|
4921
5147
|
DERIVE_MINTED_RESERVED,
|
|
@@ -4931,11 +5157,17 @@ export {
|
|
|
4931
5157
|
FIELD_SIZE_ZOOM,
|
|
4932
5158
|
FIELD_STYLE_KEYS,
|
|
4933
5159
|
FOOTER_SECTION_ID,
|
|
5160
|
+
FORM_UPLOAD,
|
|
5161
|
+
FORM_UPLOAD_DEFAULT_ACCEPT,
|
|
5162
|
+
FORM_UPLOAD_PRESETS,
|
|
5163
|
+
FORM_UPLOAD_REFUSED_EXTENSIONS,
|
|
4934
5164
|
FRAME_REFUSALS,
|
|
4935
5165
|
HELP_CAPS,
|
|
4936
5166
|
HELP_LINE_MAX,
|
|
4937
5167
|
HELP_MAX,
|
|
4938
5168
|
HELP_WRITE_MAX,
|
|
5169
|
+
ICON_LABEL_MAX,
|
|
5170
|
+
ICON_SOURCES,
|
|
4939
5171
|
IMAGE_ASPECTS,
|
|
4940
5172
|
IMAGE_FRAME_RADIUS,
|
|
4941
5173
|
KEY_FORBIDDEN,
|
|
@@ -4988,12 +5220,14 @@ export {
|
|
|
4988
5220
|
SPACE_BOTTOM_TOKENS,
|
|
4989
5221
|
SPACE_STEP_TOKENS,
|
|
4990
5222
|
TABLE_COLUMN_TYPES,
|
|
5223
|
+
TABLE_CSS,
|
|
4991
5224
|
TABLE_JSONLD_TYPES,
|
|
4992
5225
|
TABLE_LIMITS,
|
|
4993
5226
|
TABLE_RESPONSIVE,
|
|
4994
5227
|
TAB_MAX,
|
|
4995
5228
|
TAB_MAX_RENDERABLE_NOW,
|
|
4996
5229
|
TAG_HEADS,
|
|
5230
|
+
THEME_TOKENS,
|
|
4997
5231
|
UI_PROTOCOLS,
|
|
4998
5232
|
UI_REFUSAL_CODES,
|
|
4999
5233
|
UI_REFUSAL_IDS,
|
|
@@ -5022,6 +5256,7 @@ export {
|
|
|
5022
5256
|
buttonVariantOf,
|
|
5023
5257
|
candidateRole,
|
|
5024
5258
|
canonicalJson,
|
|
5259
|
+
compactIcon,
|
|
5025
5260
|
componentInstanceAddresses,
|
|
5026
5261
|
componentPropTargetKey,
|
|
5027
5262
|
derivedPairs,
|
|
@@ -5037,12 +5272,20 @@ export {
|
|
|
5037
5272
|
fieldGroupOf,
|
|
5038
5273
|
fieldStyleCssText,
|
|
5039
5274
|
fieldStyleToCss,
|
|
5275
|
+
fileExtension,
|
|
5276
|
+
fileFieldLimits,
|
|
5277
|
+
formUploadAccept,
|
|
5278
|
+
formUploadLimits,
|
|
5040
5279
|
formatNumber,
|
|
5041
5280
|
formatPropsAttribute,
|
|
5042
5281
|
getBlockType,
|
|
5043
5282
|
headingPaintCss,
|
|
5044
5283
|
hiddenEverywhere,
|
|
5045
5284
|
hideOnAttr,
|
|
5285
|
+
iconHtml,
|
|
5286
|
+
iconIdentity,
|
|
5287
|
+
iconSrc,
|
|
5288
|
+
iconValueProblem,
|
|
5046
5289
|
imageFrameCss,
|
|
5047
5290
|
inWindow,
|
|
5048
5291
|
isBlock,
|
|
@@ -5053,7 +5296,9 @@ export {
|
|
|
5053
5296
|
isDeriveReservedKey,
|
|
5054
5297
|
isDockUiImportAllowed,
|
|
5055
5298
|
isEmbedReason,
|
|
5299
|
+
isIconObjectForm,
|
|
5056
5300
|
isLinkObject,
|
|
5301
|
+
isRefusedUploadExtension,
|
|
5057
5302
|
isReservedKey,
|
|
5058
5303
|
isRoleKey,
|
|
5059
5304
|
isRulePaired,
|
|
@@ -5072,6 +5317,7 @@ export {
|
|
|
5072
5317
|
locatorPath,
|
|
5073
5318
|
mayOverwrite,
|
|
5074
5319
|
normaliseRichTextFeatures,
|
|
5320
|
+
normalizeIcon,
|
|
5075
5321
|
normalizeLinkValue,
|
|
5076
5322
|
normalizeTableValue,
|
|
5077
5323
|
normalizeWindow,
|
|
@@ -5087,6 +5333,7 @@ export {
|
|
|
5087
5333
|
referenceCreateRefusal,
|
|
5088
5334
|
regionOf,
|
|
5089
5335
|
renderTableHtml,
|
|
5336
|
+
resolveIconOptions,
|
|
5090
5337
|
richTextRefusal,
|
|
5091
5338
|
rulePartnerOf,
|
|
5092
5339
|
safeCssUrl,
|
|
@@ -5120,6 +5367,7 @@ export {
|
|
|
5120
5367
|
visibleLayoutStructure,
|
|
5121
5368
|
windowState,
|
|
5122
5369
|
withButtonLookProps,
|
|
5123
|
-
withExample
|
|
5370
|
+
withExample,
|
|
5371
|
+
withIconLabel
|
|
5124
5372
|
};
|
|
5125
5373
|
//# sourceMappingURL=index.js.map
|