@seamline-kit/seamline-settings 0.0.3 → 0.0.4

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.
@@ -1,945 +0,0 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s } from "../lib-DIb46Sli.js";
2
- import { init as c } from "../main.js";
3
- import { Fragment as l, jsx as u, jsxs as d } from "solid-jsx/jsx-runtime";
4
- var f = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, p = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, m = {};
5
- /**
6
- * Checks if the given value is a valid identifier name.
7
- *
8
- * @param {string} name
9
- * Identifier to check.
10
- * @param {Options | null | undefined} [options]
11
- * Configuration (optional).
12
- * @returns {boolean}
13
- * Whether `name` can be an identifier.
14
- */
15
- function h(e, t) {
16
- return ((t || m).jsx ? p : f).test(e);
17
- }
18
- /**
19
- * @typedef {import('hast').Nodes} Nodes
20
- */
21
- var g = /[ \t\n\f\r]/g;
22
- /**
23
- * Check if the given value is *inter-element whitespace*.
24
- *
25
- * @param {Nodes | string} thing
26
- * Thing to check (`Node` or `string`).
27
- * @returns {boolean}
28
- * Whether the `value` is inter-element whitespace (`boolean`): consisting of
29
- * zero or more of space, tab (`\t`), line feed (`\n`), carriage return
30
- * (`\r`), or form feed (`\f`); if a node is passed it must be a `Text` node,
31
- * whose `value` field is checked.
32
- */
33
- function _(e) {
34
- return typeof e == "object" ? e.type === "text" ? v(e.value) : !1 : v(e);
35
- }
36
- /**
37
- * @param {string} value
38
- * @returns {boolean}
39
- */
40
- function v(e) {
41
- return e.replace(g, "") === "";
42
- }
43
- var y = /* @__PURE__ */ t(((e, t) => {
44
- var n = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, r = /\n/g, i = /^\s*/, a = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, o = /^:\s*/, s = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, c = /^[;\s]*/, l = /^\s+|\s+$/g, u = "\n", d = "/", f = "*", p = "", m = "comment", h = "declaration";
45
- /**
46
- * @param {String} style
47
- * @param {Object} [options]
48
- * @return {Object[]}
49
- * @throws {TypeError}
50
- * @throws {Error}
51
- */
52
- function g(e, t) {
53
- if (typeof e != "string") throw TypeError("First argument must be a string");
54
- if (!e) return [];
55
- t ||= {};
56
- /**
57
- * Positional.
58
- */
59
- var l = 1, g = 1;
60
- /**
61
- * Update lineno and column based on `str`.
62
- *
63
- * @param {String} str
64
- */
65
- function v(e) {
66
- var t = e.match(r);
67
- t && (l += t.length);
68
- var n = e.lastIndexOf(u);
69
- g = ~n ? e.length - n : g + e.length;
70
- }
71
- /**
72
- * Mark position and patch `node.position`.
73
- *
74
- * @return {Function}
75
- */
76
- function y() {
77
- var e = {
78
- line: l,
79
- column: g
80
- };
81
- return function(t) {
82
- return t.position = new b(e), C(), t;
83
- };
84
- }
85
- /**
86
- * Store position information for a node.
87
- *
88
- * @constructor
89
- * @property {Object} start
90
- * @property {Object} end
91
- * @property {undefined|String} source
92
- */
93
- function b(e) {
94
- this.start = e, this.end = {
95
- line: l,
96
- column: g
97
- }, this.source = t.source;
98
- }
99
- /**
100
- * Non-enumerable source string.
101
- */
102
- b.prototype.content = e;
103
- /**
104
- * Error `msg`.
105
- *
106
- * @param {String} msg
107
- * @throws {Error}
108
- */
109
- function x(n) {
110
- var r = /* @__PURE__ */ Error(t.source + ":" + l + ":" + g + ": " + n);
111
- if (r.reason = n, r.filename = t.source, r.line = l, r.column = g, r.source = e, !t.silent) throw r;
112
- }
113
- /**
114
- * Match `re` and return captures.
115
- *
116
- * @param {RegExp} re
117
- * @return {undefined|Array}
118
- */
119
- function S(t) {
120
- var n = t.exec(e);
121
- if (n) {
122
- var r = n[0];
123
- return v(r), e = e.slice(r.length), n;
124
- }
125
- }
126
- /**
127
- * Parse whitespace.
128
- */
129
- function C() {
130
- S(i);
131
- }
132
- /**
133
- * Parse comments.
134
- *
135
- * @param {Object[]} [rules]
136
- * @return {Object[]}
137
- */
138
- function w(e) {
139
- var t;
140
- for (e ||= []; t = T();) t !== !1 && e.push(t);
141
- return e;
142
- }
143
- /**
144
- * Parse comment.
145
- *
146
- * @return {Object}
147
- * @throws {Error}
148
- */
149
- function T() {
150
- var t = y();
151
- if (!(d != e.charAt(0) || f != e.charAt(1))) {
152
- for (var n = 2; p != e.charAt(n) && (f != e.charAt(n) || d != e.charAt(n + 1));) ++n;
153
- if (n += 2, p === e.charAt(n - 1)) return x("End of comment missing");
154
- var r = e.slice(2, n - 2);
155
- return g += 2, v(r), e = e.slice(n), g += 2, t({
156
- type: m,
157
- comment: r
158
- });
159
- }
160
- }
161
- /**
162
- * Parse declaration.
163
- *
164
- * @return {Object}
165
- * @throws {Error}
166
- */
167
- function E() {
168
- var e = y(), t = S(a);
169
- if (t) {
170
- if (T(), !S(o)) return x("property missing ':'");
171
- var r = S(s), i = e({
172
- type: h,
173
- property: _(t[0].replace(n, p)),
174
- value: r ? _(r[0].replace(n, p)) : p
175
- });
176
- return S(c), i;
177
- }
178
- }
179
- /**
180
- * Parse declarations.
181
- *
182
- * @return {Object[]}
183
- */
184
- function D() {
185
- var e = [];
186
- w(e);
187
- for (var t; t = E();) t !== !1 && (e.push(t), w(e));
188
- return e;
189
- }
190
- return C(), D();
191
- }
192
- /**
193
- * Trim `str`.
194
- *
195
- * @param {String} str
196
- * @return {String}
197
- */
198
- function _(e) {
199
- return e ? e.replace(l, p) : p;
200
- }
201
- t.exports = g;
202
- })), b = /* @__PURE__ */ t(((e) => {
203
- var t = e && e.__importDefault || function(e) {
204
- return e && e.__esModule ? e : { default: e };
205
- };
206
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = r;
207
- var n = t(y());
208
- /**
209
- * Parses inline style to object.
210
- *
211
- * @param style - Inline style.
212
- * @param iterator - Iterator.
213
- * @returns - Style object or null.
214
- *
215
- * @example Parsing inline style to object:
216
- *
217
- * ```js
218
- * import parse from 'style-to-object';
219
- * parse('line-height: 42;'); // { 'line-height': '42' }
220
- * ```
221
- */
222
- function r(e, t) {
223
- let r = null;
224
- if (!e || typeof e != "string") return r;
225
- let i = (0, n.default)(e), a = typeof t == "function";
226
- return i.forEach((e) => {
227
- if (e.type !== "declaration") return;
228
- let { property: n, value: i } = e;
229
- a ? t(n, i, e) : i && (r ||= {}, r[n] = i);
230
- }), r;
231
- }
232
- })), x = /* @__PURE__ */ t(((e) => {
233
- Object.defineProperty(e, "__esModule", { value: !0 }), e.camelCase = void 0;
234
- var t = /^--[a-zA-Z0-9_-]+$/, n = /-([a-z])/g, r = /^[^-]+$/, i = /^-(webkit|moz|ms|o|khtml)-/, a = /^-(ms)-/, o = function(e) {
235
- return !e || r.test(e) || t.test(e);
236
- }, s = function(e, t) {
237
- return t.toUpperCase();
238
- }, c = function(e, t) {
239
- return `${t}-`;
240
- };
241
- e.camelCase = function(e, t) {
242
- return t === void 0 && (t = {}), o(e) ? e : (e = e.toLowerCase(), e = t.reactCompat ? e.replace(a, c) : e.replace(i, c), e.replace(n, s));
243
- };
244
- })), S = /* @__PURE__ */ t(((e, t) => {
245
- var n = (e && e.__importDefault || function(e) {
246
- return e && e.__esModule ? e : { default: e };
247
- })(b()), r = x();
248
- /**
249
- * Parses CSS inline style to JavaScript object (camelCased).
250
- */
251
- function i(e, t) {
252
- var i = {};
253
- return !e || typeof e != "string" || (0, n.default)(e, function(e, n) {
254
- e && n && (i[(0, r.camelCase)(e, t)] = n);
255
- }), i;
256
- }
257
- i.default = i, t.exports = i;
258
- }));
259
- /**
260
- * Get the starting point of `node`.
261
- *
262
- * @param node
263
- * Node.
264
- * @returns
265
- * Point.
266
- */
267
- const C = w("start");
268
- /**
269
- * Get the positional info of `node`.
270
- *
271
- * @param {'end' | 'start'} type
272
- * Side.
273
- * @returns
274
- * Getter.
275
- */
276
- function w(e) {
277
- return t;
278
- /**
279
- * Get the point info of `node` at a bound side.
280
- *
281
- * @param {Node | NodeLike | null | undefined} [node]
282
- * @returns {Point | undefined}
283
- */
284
- function t(t) {
285
- let n = t && t.position && t.position[e] || {};
286
- if (typeof n.line == "number" && n.line > 0 && typeof n.column == "number" && n.column > 0) return {
287
- line: n.line,
288
- column: n.column,
289
- offset: typeof n.offset == "number" && n.offset > -1 ? n.offset : void 0
290
- };
291
- }
292
- }
293
- /**
294
- * @typedef {import('unist').Node} Node
295
- * @typedef {import('unist').Point} Point
296
- * @typedef {import('unist').Position} Position
297
- */
298
- /**
299
- * @typedef NodeLike
300
- * @property {string} type
301
- * @property {PositionLike | null | undefined} [position]
302
- *
303
- * @typedef PointLike
304
- * @property {number | null | undefined} [line]
305
- * @property {number | null | undefined} [column]
306
- * @property {number | null | undefined} [offset]
307
- *
308
- * @typedef PositionLike
309
- * @property {PointLike | null | undefined} [start]
310
- * @property {PointLike | null | undefined} [end]
311
- */
312
- /**
313
- * Serialize the positional info of a point, position (start and end points),
314
- * or node.
315
- *
316
- * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]
317
- * Node, position, or point.
318
- * @returns {string}
319
- * Pretty printed positional info of a node (`string`).
320
- *
321
- * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
322
- * or a point `l:c` (when given `point`), where `l` stands for line, `c` for
323
- * column, `s` for `start`, and `e` for end.
324
- * An empty string (`''`) is returned if the given value is neither `node`,
325
- * `position`, nor `point`.
326
- */
327
- function T(e) {
328
- return !e || typeof e != "object" ? "" : "position" in e || "type" in e ? D(e.position) : "start" in e || "end" in e ? D(e) : "line" in e || "column" in e ? E(e) : "";
329
- }
330
- /**
331
- * @param {Point | PointLike | null | undefined} point
332
- * @returns {string}
333
- */
334
- function E(e) {
335
- return O(e && e.line) + ":" + O(e && e.column);
336
- }
337
- /**
338
- * @param {Position | PositionLike | null | undefined} pos
339
- * @returns {string}
340
- */
341
- function D(e) {
342
- return E(e && e.start) + "-" + E(e && e.end);
343
- }
344
- /**
345
- * @param {number | null | undefined} value
346
- * @returns {number}
347
- */
348
- function O(e) {
349
- return e && typeof e == "number" ? e : 1;
350
- }
351
- /**
352
- * @import {Node, Point, Position} from 'unist'
353
- */
354
- /**
355
- * @typedef {object & {type: string, position?: Position | undefined}} NodeLike
356
- *
357
- * @typedef Options
358
- * Configuration.
359
- * @property {Array<Node> | null | undefined} [ancestors]
360
- * Stack of (inclusive) ancestor nodes surrounding the message (optional).
361
- * @property {Error | null | undefined} [cause]
362
- * Original error cause of the message (optional).
363
- * @property {Point | Position | null | undefined} [place]
364
- * Place of message (optional).
365
- * @property {string | null | undefined} [ruleId]
366
- * Category of message (optional, example: `'my-rule'`).
367
- * @property {string | null | undefined} [source]
368
- * Namespace of who sent the message (optional, example: `'my-package'`).
369
- */
370
- /**
371
- * Message.
372
- */
373
- var k = class extends Error {
374
- /**
375
- * Create a message for `reason`.
376
- *
377
- * > 🪦 **Note**: also has obsolete signatures.
378
- *
379
- * @overload
380
- * @param {string} reason
381
- * @param {Options | null | undefined} [options]
382
- * @returns
383
- *
384
- * @overload
385
- * @param {string} reason
386
- * @param {Node | NodeLike | null | undefined} parent
387
- * @param {string | null | undefined} [origin]
388
- * @returns
389
- *
390
- * @overload
391
- * @param {string} reason
392
- * @param {Point | Position | null | undefined} place
393
- * @param {string | null | undefined} [origin]
394
- * @returns
395
- *
396
- * @overload
397
- * @param {string} reason
398
- * @param {string | null | undefined} [origin]
399
- * @returns
400
- *
401
- * @overload
402
- * @param {Error | VFileMessage} cause
403
- * @param {Node | NodeLike | null | undefined} parent
404
- * @param {string | null | undefined} [origin]
405
- * @returns
406
- *
407
- * @overload
408
- * @param {Error | VFileMessage} cause
409
- * @param {Point | Position | null | undefined} place
410
- * @param {string | null | undefined} [origin]
411
- * @returns
412
- *
413
- * @overload
414
- * @param {Error | VFileMessage} cause
415
- * @param {string | null | undefined} [origin]
416
- * @returns
417
- *
418
- * @param {Error | VFileMessage | string} causeOrReason
419
- * Reason for message, should use markdown.
420
- * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
421
- * Configuration (optional).
422
- * @param {string | null | undefined} [origin]
423
- * Place in code where the message originates (example:
424
- * `'my-package:my-rule'` or `'my-rule'`).
425
- * @returns
426
- * Instance of `VFileMessage`.
427
- */
428
- constructor(e, t, n) {
429
- super(), typeof t == "string" && (n = t, t = void 0);
430
- /** @type {string} */
431
- let r = "", i = {}, a = !1;
432
- if (t && (i = "line" in t && "column" in t || "start" in t && "end" in t ? { place: t } : "type" in t ? {
433
- ancestors: [t],
434
- place: t.position
435
- } : { ...t }), typeof e == "string" ? r = e : !i.cause && e && (a = !0, r = e.message, i.cause = e), !i.ruleId && !i.source && typeof n == "string") {
436
- let e = n.indexOf(":");
437
- e === -1 ? i.ruleId = n : (i.source = n.slice(0, e), i.ruleId = n.slice(e + 1));
438
- }
439
- if (!i.place && i.ancestors && i.ancestors) {
440
- let e = i.ancestors[i.ancestors.length - 1];
441
- e && (i.place = e.position);
442
- }
443
- let o = i.place && "start" in i.place ? i.place.start : i.place;
444
- /**
445
- * Link to docs for the message.
446
- *
447
- * > 👉 **Note**: this must be an absolute URL that can be passed as `x`
448
- * > to `new URL(x)`.
449
- *
450
- * @type {string | undefined}
451
- */
452
- this.ancestors = i.ancestors || void 0, this.cause = i.cause || void 0, this.column = o ? o.column : void 0, this.fatal = void 0, this.file = "", this.message = r, this.line = o ? o.line : void 0, this.name = T(i.place) || "1:1", this.place = i.place || void 0, this.reason = this.message, this.ruleId = i.ruleId || void 0, this.source = i.source || void 0, this.stack = a && i.cause && typeof i.cause.stack == "string" ? i.cause.stack : "", this.actual = void 0, this.expected = void 0, this.note = void 0, this.url = void 0;
453
- }
454
- };
455
- k.prototype.file = "", k.prototype.name = "", k.prototype.reason = "", k.prototype.message = "", k.prototype.stack = "", k.prototype.column = void 0, k.prototype.line = void 0, k.prototype.ancestors = void 0, k.prototype.cause = void 0, k.prototype.fatal = void 0, k.prototype.place = void 0, k.prototype.ruleId = void 0, k.prototype.source = void 0;
456
- /**
457
- * @import {Identifier, Literal, MemberExpression} from 'estree'
458
- * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'
459
- * @import {Element, Nodes, Parents, Root, Text} from 'hast'
460
- * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'
461
- * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'
462
- * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'
463
- * @import {Position} from 'unist'
464
- * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'
465
- */
466
- var ee = /* @__PURE__ */ r(S(), 1), A = {}.hasOwnProperty, j = /* @__PURE__ */ new Map(), M = /[A-Z]/g, N = new Set([
467
- "table",
468
- "tbody",
469
- "thead",
470
- "tfoot",
471
- "tr"
472
- ]), P = new Set(["td", "th"]), F = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
473
- /**
474
- * Transform a hast tree to preact, react, solid, svelte, vue, etc.,
475
- * with an automatic JSX runtime.
476
- *
477
- * @param {Nodes} tree
478
- * Tree to transform.
479
- * @param {Options} options
480
- * Configuration (required).
481
- * @returns {JsxElement}
482
- * JSX element.
483
- */
484
- function I(t, r) {
485
- if (!r || r.Fragment === void 0) throw TypeError("Expected `Fragment` in options");
486
- let i = r.filePath || void 0, a;
487
- if (r.development) {
488
- if (typeof r.jsxDEV != "function") throw TypeError("Expected `jsxDEV` in options when `development: true`");
489
- a = q(i, r.jsxDEV);
490
- } else {
491
- if (typeof r.jsx != "function") throw TypeError("Expected `jsx` in production options");
492
- if (typeof r.jsxs != "function") throw TypeError("Expected `jsxs` in production options");
493
- a = K(i, r.jsx, r.jsxs);
494
- }
495
- /** @type {State} */
496
- let o = {
497
- Fragment: r.Fragment,
498
- ancestors: [],
499
- components: r.components || {},
500
- create: a,
501
- elementAttributeNameCase: r.elementAttributeNameCase || "react",
502
- evaluater: r.createEvaluater ? r.createEvaluater() : void 0,
503
- filePath: i,
504
- ignoreInvalidStyle: r.ignoreInvalidStyle || !1,
505
- passKeys: r.passKeys !== !1,
506
- passNode: r.passNode || !1,
507
- schema: r.space === "svg" ? e : n,
508
- stylePropertyNameCase: r.stylePropertyNameCase || "dom",
509
- tableCellAlignToStyle: r.tableCellAlignToStyle !== !1
510
- }, s = L(o, t, void 0);
511
- return s && typeof s != "string" ? s : o.create(t, o.Fragment, { children: s || void 0 }, void 0);
512
- }
513
- /**
514
- * Transform a node.
515
- *
516
- * @param {State} state
517
- * Info passed around.
518
- * @param {Nodes} node
519
- * Current node.
520
- * @param {string | undefined} key
521
- * Key.
522
- * @returns {Child | undefined}
523
- * Child, optional.
524
- */
525
- function L(e, t, n) {
526
- if (t.type === "element") return R(e, t, n);
527
- if (t.type === "mdxFlowExpression" || t.type === "mdxTextExpression") return z(e, t);
528
- if (t.type === "mdxJsxFlowElement" || t.type === "mdxJsxTextElement") return V(e, t, n);
529
- if (t.type === "mdxjsEsm") return B(e, t);
530
- if (t.type === "root") return H(e, t, n);
531
- if (t.type === "text") return U(e, t);
532
- }
533
- /**
534
- * Handle element.
535
- *
536
- * @param {State} state
537
- * Info passed around.
538
- * @param {Element} node
539
- * Current node.
540
- * @param {string | undefined} key
541
- * Key.
542
- * @returns {Child | undefined}
543
- * Child, optional.
544
- */
545
- function R(t, n, r) {
546
- let i = t.schema, a = i;
547
- n.tagName.toLowerCase() === "svg" && i.space === "html" && (a = e, t.schema = a), t.ancestors.push(n);
548
- let o = Z(t, n.tagName, !1), s = J(t, n), c = X(t, n);
549
- return N.has(n.tagName) && (c = c.filter(function(e) {
550
- return typeof e == "string" ? !_(e) : !0;
551
- })), W(t, s, o, n), G(s, c), t.ancestors.pop(), t.schema = i, t.create(n, o, s, r);
552
- }
553
- /**
554
- * Handle MDX expression.
555
- *
556
- * @param {State} state
557
- * Info passed around.
558
- * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node
559
- * Current node.
560
- * @returns {Child | undefined}
561
- * Child, optional.
562
- */
563
- function z(e, t) {
564
- if (t.data && t.data.estree && e.evaluater) {
565
- let n = t.data.estree.body[0];
566
- return n.type, e.evaluater.evaluateExpression(n.expression);
567
- }
568
- Q(e, t.position);
569
- }
570
- /**
571
- * Handle MDX ESM.
572
- *
573
- * @param {State} state
574
- * Info passed around.
575
- * @param {MdxjsEsmHast} node
576
- * Current node.
577
- * @returns {Child | undefined}
578
- * Child, optional.
579
- */
580
- function B(e, t) {
581
- if (t.data && t.data.estree && e.evaluater) return e.evaluater.evaluateProgram(t.data.estree);
582
- Q(e, t.position);
583
- }
584
- /**
585
- * Handle MDX JSX.
586
- *
587
- * @param {State} state
588
- * Info passed around.
589
- * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node
590
- * Current node.
591
- * @param {string | undefined} key
592
- * Key.
593
- * @returns {Child | undefined}
594
- * Child, optional.
595
- */
596
- function V(t, n, r) {
597
- let i = t.schema, a = i;
598
- n.name === "svg" && i.space === "html" && (a = e, t.schema = a), t.ancestors.push(n);
599
- let o = n.name === null ? t.Fragment : Z(t, n.name, !0), s = Y(t, n), c = X(t, n);
600
- return W(t, s, o, n), G(s, c), t.ancestors.pop(), t.schema = i, t.create(n, o, s, r);
601
- }
602
- /**
603
- * Handle root.
604
- *
605
- * @param {State} state
606
- * Info passed around.
607
- * @param {Root} node
608
- * Current node.
609
- * @param {string | undefined} key
610
- * Key.
611
- * @returns {Child | undefined}
612
- * Child, optional.
613
- */
614
- function H(e, t, n) {
615
- /** @type {Props} */
616
- let r = {};
617
- return G(r, X(e, t)), e.create(t, e.Fragment, r, n);
618
- }
619
- /**
620
- * Handle text.
621
- *
622
- * @param {State} _
623
- * Info passed around.
624
- * @param {Text} node
625
- * Current node.
626
- * @returns {Child | undefined}
627
- * Child, optional.
628
- */
629
- function U(e, t) {
630
- return t.value;
631
- }
632
- /**
633
- * Add `node` to props.
634
- *
635
- * @param {State} state
636
- * Info passed around.
637
- * @param {Props} props
638
- * Props.
639
- * @param {unknown} type
640
- * Type.
641
- * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node
642
- * Node.
643
- * @returns {undefined}
644
- * Nothing.
645
- */
646
- function W(e, t, n, r) {
647
- typeof n != "string" && n !== e.Fragment && e.passNode && (t.node = r);
648
- }
649
- /**
650
- * Add children to props.
651
- *
652
- * @param {Props} props
653
- * Props.
654
- * @param {Array<Child>} children
655
- * Children.
656
- * @returns {undefined}
657
- * Nothing.
658
- */
659
- function G(e, t) {
660
- if (t.length > 0) {
661
- let n = t.length > 1 ? t : t[0];
662
- n && (e.children = n);
663
- }
664
- }
665
- /**
666
- * @param {string | undefined} _
667
- * Path to file.
668
- * @param {Jsx} jsx
669
- * Dynamic.
670
- * @param {Jsx} jsxs
671
- * Static.
672
- * @returns {Create}
673
- * Create a production element.
674
- */
675
- function K(e, t, n) {
676
- return r;
677
- /** @type {Create} */
678
- function r(e, r, i, a) {
679
- let o = Array.isArray(i.children) ? n : t;
680
- return a ? o(r, i, a) : o(r, i);
681
- }
682
- }
683
- /**
684
- * @param {string | undefined} filePath
685
- * Path to file.
686
- * @param {JsxDev} jsxDEV
687
- * Development.
688
- * @returns {Create}
689
- * Create a development element.
690
- */
691
- function q(e, t) {
692
- return n;
693
- /** @type {Create} */
694
- function n(n, r, i, a) {
695
- let o = Array.isArray(i.children), s = C(n);
696
- return t(r, i, a, o, {
697
- columnNumber: s ? s.column - 1 : void 0,
698
- fileName: e,
699
- lineNumber: s ? s.line : void 0
700
- }, void 0);
701
- }
702
- }
703
- /**
704
- * Create props from an element.
705
- *
706
- * @param {State} state
707
- * Info passed around.
708
- * @param {Element} node
709
- * Current element.
710
- * @returns {Props}
711
- * Props.
712
- */
713
- function J(e, t) {
714
- /** @type {Props} */
715
- let n = {}, r, i;
716
- for (i in t.properties) if (i !== "children" && A.call(t.properties, i)) {
717
- let a = te(e, i, t.properties[i]);
718
- if (a) {
719
- let [i, o] = a;
720
- e.tableCellAlignToStyle && i === "align" && typeof o == "string" && P.has(t.tagName) ? r = o : n[i] = o;
721
- }
722
- }
723
- if (r) {
724
- let t = n.style ||= {};
725
- t[e.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = r;
726
- }
727
- return n;
728
- }
729
- /**
730
- * Create props from a JSX element.
731
- *
732
- * @param {State} state
733
- * Info passed around.
734
- * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node
735
- * Current JSX element.
736
- * @returns {Props}
737
- * Props.
738
- */
739
- function Y(e, t) {
740
- /** @type {Props} */
741
- let n = {};
742
- for (let r of t.attributes) if (r.type === "mdxJsxExpressionAttribute") if (r.data && r.data.estree && e.evaluater) {
743
- let t = r.data.estree.body[0];
744
- t.type;
745
- let i = t.expression;
746
- i.type;
747
- let a = i.properties[0];
748
- a.type, Object.assign(n, e.evaluater.evaluateExpression(a.argument));
749
- } else Q(e, t.position);
750
- else {
751
- let i = r.name, a;
752
- if (r.value && typeof r.value == "object") if (r.value.data && r.value.data.estree && e.evaluater) {
753
- let t = r.value.data.estree.body[0];
754
- t.type, a = e.evaluater.evaluateExpression(t.expression);
755
- } else Q(e, t.position);
756
- else a = r.value === null ? !0 : r.value;
757
- n[i] = a;
758
- }
759
- return n;
760
- }
761
- /**
762
- * Create children.
763
- *
764
- * @param {State} state
765
- * Info passed around.
766
- * @param {Parents} node
767
- * Current element.
768
- * @returns {Array<Child>}
769
- * Children.
770
- */
771
- function X(e, t) {
772
- /** @type {Array<Child>} */
773
- let n = [], r = -1, i = e.passKeys ? /* @__PURE__ */ new Map() : j;
774
- for (; ++r < t.children.length;) {
775
- let a = t.children[r], o;
776
- if (e.passKeys) {
777
- let e = a.type === "element" ? a.tagName : a.type === "mdxJsxFlowElement" || a.type === "mdxJsxTextElement" ? a.name : void 0;
778
- if (e) {
779
- let t = i.get(e) || 0;
780
- o = e + "-" + t, i.set(e, t + 1);
781
- }
782
- }
783
- let s = L(e, a, o);
784
- s !== void 0 && n.push(s);
785
- }
786
- return n;
787
- }
788
- /**
789
- * Handle a property.
790
- *
791
- * @param {State} state
792
- * Info passed around.
793
- * @param {string} prop
794
- * Key.
795
- * @param {Array<number | string> | boolean | number | string | null | undefined} value
796
- * hast property value.
797
- * @returns {Field | undefined}
798
- * Field for runtime, optional.
799
- */
800
- function te(e, t, n) {
801
- let r = a(e.schema, t);
802
- if (!(n == null || typeof n == "number" && Number.isNaN(n))) {
803
- if (Array.isArray(n) && (n = r.commaSeparated ? o(n) : i(n)), r.property === "style") {
804
- let t = typeof n == "object" ? n : ne(e, String(n));
805
- return e.stylePropertyNameCase === "css" && (t = re(t)), ["style", t];
806
- }
807
- return [e.elementAttributeNameCase === "react" && r.space ? s[r.property] || r.property : r.attribute, n];
808
- }
809
- }
810
- /**
811
- * Parse a CSS declaration to an object.
812
- *
813
- * @param {State} state
814
- * Info passed around.
815
- * @param {string} value
816
- * CSS declarations.
817
- * @returns {Style}
818
- * Properties.
819
- * @throws
820
- * Throws `VFileMessage` when CSS cannot be parsed.
821
- */
822
- function ne(e, t) {
823
- try {
824
- return (0, ee.default)(t, { reactCompat: !0 });
825
- } catch (t) {
826
- if (e.ignoreInvalidStyle) return {};
827
- let n = t, r = new k("Cannot parse `style` attribute", {
828
- ancestors: e.ancestors,
829
- cause: n,
830
- ruleId: "style",
831
- source: "hast-util-to-jsx-runtime"
832
- });
833
- throw r.file = e.filePath || void 0, r.url = F + "#cannot-parse-style-attribute", r;
834
- }
835
- }
836
- /**
837
- * Create a JSX name from a string.
838
- *
839
- * @param {State} state
840
- * To do.
841
- * @param {string} name
842
- * Name.
843
- * @param {boolean} allowExpression
844
- * Allow member expressions and identifiers.
845
- * @returns {unknown}
846
- * To do.
847
- */
848
- function Z(e, t, n) {
849
- /** @type {Identifier | Literal | MemberExpression} */
850
- let r;
851
- if (!n) r = {
852
- type: "Literal",
853
- value: t
854
- };
855
- else if (t.includes(".")) {
856
- let e = t.split("."), n = -1, i;
857
- for (; ++n < e.length;) {
858
- /** @type {Identifier | Literal} */
859
- let t = h(e[n]) ? {
860
- type: "Identifier",
861
- name: e[n]
862
- } : {
863
- type: "Literal",
864
- value: e[n]
865
- };
866
- i = i ? {
867
- type: "MemberExpression",
868
- object: i,
869
- property: t,
870
- computed: !!(n && t.type === "Literal"),
871
- optional: !1
872
- } : t;
873
- }
874
- r = i;
875
- } else r = h(t) && !/^[a-z]/.test(t) ? {
876
- type: "Identifier",
877
- name: t
878
- } : {
879
- type: "Literal",
880
- value: t
881
- };
882
- if (r.type === "Literal") {
883
- let t = r.value;
884
- return A.call(e.components, t) ? e.components[t] : t;
885
- }
886
- if (e.evaluater) return e.evaluater.evaluateExpression(r);
887
- Q(e);
888
- }
889
- /**
890
- * @param {State} state
891
- * @param {Position | undefined} [place]
892
- * @returns {never}
893
- */
894
- function Q(e, t) {
895
- let n = new k("Cannot handle MDX estrees without `createEvaluater`", {
896
- ancestors: e.ancestors,
897
- place: t,
898
- ruleId: "mdx-estree",
899
- source: "hast-util-to-jsx-runtime"
900
- });
901
- throw n.file = e.filePath || void 0, n.url = F + "#cannot-handle-mdx-estrees-without-createevaluater", n;
902
- }
903
- /**
904
- * Transform a DOM casing style object to a CSS casing style object.
905
- *
906
- * @param {Style} domCasing
907
- * @returns {Style}
908
- */
909
- function re(e) {
910
- /** @type {Style} */
911
- let t = {}, n;
912
- for (n in e) A.call(e, n) && (t[ie(n)] = e[n]);
913
- return t;
914
- }
915
- /**
916
- * Transform a DOM casing style field to a CSS casing style field.
917
- *
918
- * @param {string} from
919
- * @returns {string}
920
- */
921
- function ie(e) {
922
- let t = e.replace(M, ae);
923
- return t.slice(0, 3) === "ms-" && (t = "-" + t), t;
924
- }
925
- /**
926
- * Make `$0` dash cased.
927
- *
928
- * @param {string} $0
929
- * Capitalized ASCII leter.
930
- * @returns {string}
931
- * Dash and lower letter.
932
- */
933
- function ae(e) {
934
- return "-" + e.toLowerCase();
935
- }
936
- function $() {
937
- return I(c().render(), {
938
- Fragment: l,
939
- jsx: u,
940
- jsxs: d,
941
- elementAttributeNameCase: "html",
942
- stylePropertyNameCase: "css"
943
- });
944
- }
945
- export { $ as SeamlineSettings, $ as default };